.NET programs memory consumption

G

Guest

I noticed that my windows application, very simple test written in C#, keeps
and keeps allocating memory.

For example, when at the start it has allocated 7500kB, after few minutes,
memory allocation is 12000kB. Even if i don't click any buttons or so. And
when i start clicking a button, with no event handling, it allocated 40k more
memory on every click. Is this normal? Why program needs extra memory after a
dummie button click?

I'm using .NET 2.0 and Visual C# Express, on WinXP Home with AMD64. Memory
figures are taken from task manager.
 
W

Willy Denoyette [MVP]

AIK said:
I noticed that my windows application, very simple test written in C#,
keeps
and keeps allocating memory.

For example, when at the start it has allocated 7500kB, after few minutes,
memory allocation is 12000kB. Even if i don't click any buttons or so. And
when i start clicking a button, with no event handling, it allocated 40k
more
memory on every click. Is this normal? Why program needs extra memory
after a
dummie button click?

I'm using .NET 2.0 and Visual C# Express, on WinXP Home with AMD64. Memory
figures are taken from task manager.

This is normal, the memory consumption will cease to climb at a certain
point, what you are experiencing is the result of JIT compilation and object
creation when clicking a button. Once all code in this execution path is
compiled the memory occupation will stabilize and the GC collector will take
care of the object clean-up (when he sees fit).

Willy.
 

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