[vtkusers] Memory management issues: how to track memory usage?

David Lonie david.lonie at kitware.com
Thu Aug 11 11:14:01 EDT 2016

On Thu, Aug 11, 2016 at 10:10 AM, BBerco <bebe0705 at colorado.edu> wrote:
> David,
> thanks for clarifying. Indeed, I was not using Delete() properly.
> Initialize() seems to fit my purpose better, as its documentation reads
> "Restore object to initial state. Release memory back to system.". I can
> indeed observe that a given member's memory usage goes to zero after I call
> its Initialize() method and GetActualMemorySize afterwards.

Great, glad that's figured out.

> However, the total memory usage (as calculated by Xcode) of the program does
> not change whether I use Initialize() or not. The freed memory has to go
> somewhere still ?

See my earlier comments about OS caching. The operating system is
likely reserving some of the freed memory as cache memory to be reused
by the application. Google around a bit and see if you can find some
way to free/check the per-process cached memory for your operating


More information about the vtkusers mailing list