There is almost a megabyte on unfreed but reachable memorymalloc/free: in use at exit: 974296 bytes in 7456 blocks.So there is a leak, but looks like it's not in Qt but rather somewhere in XLib and libc.
There is almost a megabyte on unfreed but reachable memorymalloc/free: in use at exit: 974296 bytes in 7456 blocks.So there is a leak, but looks like it's not in Qt but rather somewhere in XLib and libc.
In most cases I think that's application allocate more memoryOriginally Posted by wysota
Succes is 5% of talent and 95% of work!
The thing is this memory is unfreed upon program termination, which is considered a leak. I don't investigate how much memory does the process allocate during its life.Originally Posted by blackliteon
BTW: "malloc/free: 236588 allocs, 229132 frees, 66411306 bytes allocated."
Sure you right!Originally Posted by wysota
Succes is 5% of talent and 95% of work!
We need another tool here: Valgrind gives only total statistics not time samples and peak memory usage. Does anybody know of such a tool?
You mean memory leak or speed ?Originally Posted by Codepoet
Succes is 5% of talent and 95% of work!
Valgrind is slow, yes - but that is not the reason: Valgrind does not collect statistics about things like:
- maximum amount of memory used
- memory usage while the application runs
- graph of used memory by elapsed time
These 66MB are the total amount of memory the program allocated during the whole run. But we are interested in how much did it use at any given time. That is a big difference since memory is freed again, then allocated and so on. We have many short lived objects.
At the moment I'm trying memprof but it crashes![]()
Limit resources which can be given to a single process to a known amount, and you'll get info if the limit was met. See manual for ulimit for details. Or try mpatrol. Or do your own statistics, for example by overriding new and delete and using LD_PRELOAD.
When running plugandpaint under mpatrol it's horribly slow, even slower then valgrind. Somewhere in mpatrol seems to be a bug because I constantly get errors about memmove on freed memory![]()
Nevertheless I've got some numbers: around 3.5 MB peak memory usage of plugandpaint
I'll probably write my own library because I need one for my own job in the long term.
It's in several libraries, part of them Qt. But this kind of leak will probably not increase while your program is running because it could have been freed.Originally Posted by wysota
I've attached another valgrind run with more details.
Bookmarks