-1

I use open source dynamic library (spider monkey) , and found memory usage is growing and it will be free when program exit.

but I didn't know where ?

How do I detect something like this

I've used valgrind to detect memory leak , and it report no memory leak.

Thank you very much for you kindness help.

Best Regards

Den

Denny
  • 449
  • 4
  • 17
  • If the application properly cleans up after itself and frees all allocated resources (including memory) before it exits, then there is no leak. What you're most likely seeing is an operating system optimization technique that simply don't unmap memory areas when allocated memory is freed. – Some programmer dude May 07 '14 at 11:57
  • You can use DebugDiag or Windbg are better tools for this, but are you intending to find issue in 3rd party dll? – DNamto May 07 '14 at 11:57
  • You don't have a memory leak. You are trying to moitor the memory usage during execution which is not the same thing. I haven't used valgrind all that much.. the AQtime profiler (windows) allows you to see the number of objects that are allocated during program execution and can monitor the process. Perhaps valgrind offers something similar or there is a UI available. A quick look at the valgrind docs reveals that it has monitor commands - perhaps that is the place to start looking.. – Pete May 07 '14 at 12:01
  • @JoachimPileborg I didn't say it leak , I say it keep growing – Denny May 07 '14 at 14:19
  • @Pete I working on linux any monitor tool please advise – Denny May 07 '14 at 14:19
  • @DNamto is that tool can use on Cent OS linux ? – Denny May 07 '14 at 14:21
  • And I still say it's okay because it's an operating system optimization. [Here's an answer I made yetsterday about just this](http://stackoverflow.com/a/23488556/440558). – Some programmer dude May 07 '14 at 14:31
  • @JoachimPileborg My program keep repeating new and free an object, if it's OS optimization , it should reuse the same map , but my program keep using more memory, I monitor by top command , Please advise – Denny May 07 '14 at 15:41

1 Answers1

0

Using massif tool in valgrind will help to snapshot heap profile

localtime_r consuming some memory before program exit

Community
  • 1
  • 1
Denny
  • 449
  • 4
  • 17