Garbage Collection Problem

O

Olaf Herrmann

In my Application I have the phenomenon, that the memory used by the garbage
collector
growths and growths slowly. I can not see any reason for that.

1. I think, a possible way to find out who is the bad guy, is to inspect
whats inside the
garbage collector. Does anyone knows a way to do this ?

2. Is there anyone, who has an idea in which situation the gc produces
unpredictables result or is there a document available with some hints.

Thank You,

Olaf Herrmann
 
A

Alex Yakhnin [MVP]

1. I think, a possible way to find out who is the bad guy, is to inspect
whats inside the
garbage collector. Does anyone knows a way to do this ?

2. Is there anyone, who has an idea in which situation the gc produces
unpredictables result or is there a document available with some hints.

Olaf, I am not aware of anything like that available anywhere.

Why do you think it's a problem of the GC and not there's something wrong in
your code?

Could you describe what you're doing and why you think it is the GC
mis-behaves?
 
M

Microsoft MVP ¸­¨Õ»a\(Jan Yeh\) for Windows CE .NE

Hello, Olaf

GC in Pocket PC would act much faster than in PC.
Almost when you close an object, GC will collect it immediately.

Maybe you can monitor and compare the situation between
other .NETcf applications and your own. Try to figure out
what is the problem.
--
Best Regards,
Jan Yeh

MVP(Windows CE.NET), MCAD, .NETcf Developer & Consultant
Mobile Mind Co., Ltd. @ Taiwan
 
O

Olaf Herrmann

Hello,

I'm back again.

I've made some further investigations about my problem.

The gc grows only when I open a form with form.ShowDialog from a button
click when the button
resides in a form wich was opened in the same manner.

This is the sequence:
MainForm -> Button -> ClickEventHandler -> Form.ShowDialog -> Button ->
ClickEventHandler ->
OtherForm.ShowDialog -> Close -> Close

Then I collect the gc and look at Gc.GetTotalMemory ( true ) result.

I repeated the sequence 20 or 50 times and after an unspecified number of
sequences
the gc memory is higher than before. If I continue the above sequence the gc
memory grows.

May be it is not allowed to open a dialog from inside another ?

Thank You

Olaf Herrmann
 

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

Top