471,319 Members | 996 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,319 software developers and data experts.

Memory Issues?



I seem to be having some problems with .NET running a garbage collection.

I have setup an application that reads in records from a database into a
dataset. The user needs to modify a group of rows in this dataset, a save
routine is run when they are done with all of their modifications, and the
dataset is passed back to the SQL server.

We aren't talking about lots of rows here. The max selection will be 50K
(which is a lot but nothing obscene)

When I run the app I watch the memory for the application jump from 20MB to
60MB. When I close the child form I get no memory back even though I
specificly call GC.Collect (for testing purposes only) Even after extended
periods the memory is not recycled.

Also when I am closing the forms I am expcitly calling the Dataset.Dispose()
methods as well as any other dispose object that may be unmanaged.

An even bigger memory gain is seen if I run a Crystal Report on an ADO.NET
dataset. up to 120MB, again never to be returned to the OS until the
application is completly shut down.

The problem is that this application will be run on a Windows Terminal
server and if I keep grabbing memory like this and not returning it over
30,40 users I am going to have a big memory problem.

Anyone have any thoughts?

Thanks,

Justin
Jul 25 '05 #1
3 1414
Justin,

All what you tell does not free any memory.

An object is released if it has not any reference anymore to something or
that there is nothing referencing it anymore.

That is what the GC checks to release it. Calling the GC thousand times does
nothing more than eating processing time, if that condition is not
fullfilled.

(Although you should not rely on the taskmanager the information given in
that says nothing, see some of the messages from Willy in this newsgroup)

http://groups-beta.google.com/group/...rch+this+group

I hope this helps,

Cor
Jul 25 '05 #2
Cor,

Thanks for the info. After reading a bunch of posts in this and the
performance new group I realized I am not the only one to look at this
improperly.

I understand that the GC will collect when it comes down to a memory crunch,
but my specific concern is that this is running on the terminal server. If
each session allocates this memory to itself and does not share it across
the sessions, then 30 users running a 125 in their heap will tie up 3.7Gig I
have 4GB in these terminal servers but that doesn't leave a lot of room.

Anyone have experience with this specific situation?

Also I am calling the dispose and close methods of everything that I can on
the MDIChild close, there are no references to anything in the MDIChild on
the parent.

One other thing that I noticed when I run the Allocation Profiler, is that
there are a lot of assemblies called in the MDI child that are still open
when I close that child.

Is there any way to force these assemblies to unload or does .Net hold them
open for better performance on the next run?

I appreciate the input.

Thanks,
Justin
"Cor Ligthert [MVP]" <no************@planet.nl> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Justin,

All what you tell does not free any memory.

An object is released if it has not any reference anymore to something or
that there is nothing referencing it anymore.

That is what the GC checks to release it. Calling the GC thousand times
does nothing more than eating processing time, if that condition is not
fullfilled.

(Although you should not rely on the taskmanager the information given in
that says nothing, see some of the messages from Willy in this newsgroup)

http://groups-beta.google.com/group/...rch+this+group

I hope this helps,

Cor

Jul 26 '05 #3
Justin,

In your case would I make a new question crossposted to this newsgroup, the
newsgroup of your programming language and a kind of terminal server
language.

I would make the subject
"Memory problems with Terminal Server"

Why crossposting to this newsgroup. At least because I am as well interested
in the answers and I am not active in C#.

:-)

Cor
Jul 26 '05 #4

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

18 posts views Thread by Tron Thomas | last post: by
4 posts views Thread by Simon Johnson | last post: by
14 posts views Thread by Joe | last post: by
2 posts views Thread by ruca | last post: by
5 posts views Thread by Frank Rizzo | last post: by
3 posts views Thread by Sam Samson | last post: by
22 posts views Thread by Peter | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.