Manage the Allocate memory (every new object) on C# solutions

  • Thread starter Thread starter cnimrod
  • Start date Start date
C

cnimrod

Hi,

I need to "catch" every object that is tring to be written to memory
(every line like String s = new String() and etc.)
Can I overload it? Can Ioverride it?
I need it to be general in all my solution and with out doing anything
specail in the other projects (like inheritance from interface or
abstract class).

Thanks,
Nimrod
 
I need to "catch" every object that is tring to be written to memory
(every line like String s = new String() and etc.)
Why?

Can I overload it? Can Ioverride it?
No.

I need it to be general in all my solution and with out doing anything
specail in the other projects (like inheritance from interface or
abstract class).

The only way you could do this would be to hook into the profiling API
- which is designed for profilers rather than normal applications.

What are you trying to achieve?
 
Nimrod,

It should be possible, however be aware that it will cost you a bunch of
memory probably multiple times from the memory that will be used by your
sample.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top