I have an actionclass which is called by ajax on the web page.
I create only an object of Testclass.
Looking in a memory profiler I can see that for each ajax request there is a new Testclass on the heap.
Even if thisClass in nulled it is still there on the heap.
And next time this action executes there are 2 Testclass on the heap etc...
Is there anyone who can tell me whats wrong?
I have been struggling with this problem a few days now and are starting to get desperate.
It's better to be approximately right than exactly wrong.
Garbage collection is not instantaneous. If you have a large heap, you may accumulate many instances before they are swept up.
Your profiler may have a way to trigger garbage collection. Try that and see what happens.