[Qt-interest] Is there a platform-independent way to get the available amount of memory?

Jason H scorp1us at yahoo.com
Sat Feb 26 14:33:49 CET 2011


It looks like QSystemStorageInfo should, but I don't see methods.

<preachy reluctant="true">
The thing that I was always told in response to this line of thinking, is unless 
you're on embedded hardware with a single purpose, you don't really know what is 
best for the system.On a phone, you might now 64MB storage 512mb ram, but how 
many apps is the user running? It gets even worse for desktops and servers. I've 
always been told to assume there isn't enough ram, you will swap some, and in 
the end your application will be optimized for the average case, and will be 
much better for the user. It leads to problems when you think you're entitled... 
the user will observe that if your app is open, its the only thing he can do. 
Which is no favor to the user. He's got a multitasking OS and expects to use it.

So I'd advise not to assume you have static resources, and just do the 20% that 
gets you 80% of the gain... like sparse indexes. Your users will thank you

</preachy>



----- Original Message ----
From: Robert Hairgrove <evorgriahr at hispeed.ch>
To: qt-interest at qt.nokia.com
Sent: Sat, February 26, 2011 7:46:13 AM
Subject: [Qt-interest] Is there a platform-independent way to get the available 
amount of memory?

Is there a Qt module or function that returns the available amount of
system RAM and/or virtual memory available? This would be useful for
limiting file sizes for certain things, such as an in-memory database. I
couldn't find anything like that anywhere in the docs.

_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest



      



More information about the Qt-interest-old mailing list