Memory Management

  • Thread starter Thread starter Manish Parikh
  • Start date Start date
M

Manish Parikh

Hi All

A Show Stopper problem in our application

we have a DLL which exposes some objects collections in terms of get and
set properties. The objects have very heavy memory footprints (beyond 2gb)
we want to have the funcionality that if the memory usage goes beyond a
certain threshold limit we persist the content of these objects in hard disk
and destroy them to free up the memory.


Problem is, the instance to these objects will be created in the
Applications using this component. Can we free up the memory by destroying
these objects even if they are being refrenced from the client application?


Any Leads / Suggestions are most welcome

Regards,

Manish
 
Well, that has strongly to do with your design, in general its not possible
to destroy an object another class has a reference to.
If the situation is right, you could use a proxy class; basically a class
that behaves like the class you want to expose, but calls back into your
component to get the data it needs, allowing it to notify you and you to
recreate or reload the object as needed.
However, if the object is strongly referenced, you cannot destroy it, that
could actually be disasterous.
 
Manish Parikh said:
Hi All

A Show Stopper problem in our application

we have a DLL which exposes some objects collections in terms of get and
set properties. The objects have very heavy memory footprints (beyond 2gb)
we want to have the funcionality that if the memory usage goes beyond a
certain threshold limit we persist the content of these objects in hard disk
and destroy them to free up the memory.

When you say "footprint beyond 2gb", are you talking about working set, or
simply total size in virtual memory? If the latter, then you will probably
be better off allowing the operating system to decide when to send memory to
the disk.
 
Back
Top