Does prstat SIZE value in Solaris increase indicate memory leak?
In my program, I create 100 threads, then wait for all of them to join and then repeat this operation again.
In each of the threads, I create some memory and free it. I am fairly sure, all the memory which I am creating in those threads are getting freed.
But, the SIZE output and RSS output of prstat are continously increasing. They are increasing regularly by 4M
What do these values indicate? Does it mean there is some memory leak?
EDIT:
My original intention was to find out what is the meaning of SIZE & RSS columns in prstat output. Also, does increase in the v开发者_StackOverflowalue shown by SIZE confirm the presence of memory leak in the code?
No, prstat SIZE increase doesn't necessarily indicate a memory leak. You can only guess that there might be a memory leak. Moreover, when using the standard Solaris malloc/free libraries, freed memory is not returned to the OS so the SIZE metric is never decreasing. You should really post a sample source code exhibiting the issue to help figuring out if you really experiencing a memory leak.
Yes, continuously increasing memory usage indicates a memory leak.
精彩评论