Hello guys,
I "wrote" a really minimal application using Qt and QtCreator.
This app do nothing, only display an empty window with a title.
I discover that an application like this use 7% of memory on N900 (measured with conky and top). My question is: why? there is a way to improve this?
If you want try this only create a GUI application from QtCreator and run it on N900 using QtCreator debug option.
What are you measuring there? Virtual size, resident size, or non-shared memory? Most of the memory in a basic app like that will probably be the Qt libraries, which will be shared between all apps using them.
On Maemo (in particular), Qt uses Hildon/Gtk+ to render widgets, which will also (wrongly) be attributed to that 7%.
There has been some recent work ongoing in parts of Qt to help lower resource usage (particularly in text rendering), but my advice would be to just not focus on this too heavily unless you notice it becoming a real problem.
you are right, but i can't answer to your question. Conky only display a generic "mem" and also top doesn't give more advice than "%mem" on N900.
I dont think that only the libs can takes so much memory but i'm not sure. If they are shared and i open a second application like this, its memory usage must be really low. is it?
From my readings, the %MEM indicator in top measures the resident size, and should exclude shared libraries (though top also indicates 0k shared memory, so it may not be working that out correctly).
From my point of view this is a vexing problem, but based on what wrote w00t i think that "normal" developer can't do very much to solve this. I hope Qt next version can remove this problem
From my readings, the %MEM indicator in top measures the resident size, and should exclude shared libraries (though top also indicates 0k shared memory, so it may not be working that out correctly).
I've done a little digging, and it looks like shared libraries are included in the memory usage of each app (it's non-trivial for the system to calculate it any other way), so this'll be what makes up most of the memory usage. You should be able to get an idea of the incremental memory cost of the application by seeing how much the free memory changes when it's started. This should differ depending on whether you have other Qt applications running or not.
I've done a little digging, and it looks like shared libraries are included in the memory usage of each app (it's non-trivial for the system to calculate it any other way), so this'll be what makes up most of the memory usage. You should be able to get an idea of the incremental memory cost of the application by seeing how much the free memory changes when it's started. This should differ depending on whether you have other Qt applications running or not.
Thank you! i will do this try and see what happen...