473,385 Members | 1,353 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 1517
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
by: Tron Thomas | last post by:
Given the following information about memory management in C++: ----- The c-runtime dynamic memory manager (and most other commercial memory managers) has issues with fragmentation similar to a...
29
by: keredil | last post by:
Hi, Will the memory allocated by malloc get released when program exits? I guess it will since when the program exits, the OS will free all the memory (global, stack, heap) used by this...
25
by: Zeng | last post by:
I finally narrowed down my code to this situation, quite a few (not all) of my CMyClass objects got hold up after each run of this function via the simple webpage that shows NumberEd editbox. My...
4
by: Simon Johnson | last post by:
Dear All, I have decided to take the big plunge and drop the Microsoft platform and use Mod_Python and Apache in it's place. I've never used Linux before this project so it's a really big...
14
by: Joe | last post by:
I'm trying to track down where objects are referenced because I want to clean up the memory when I'm done with them. I thought I found all references but it doesn't seem that way because calling...
2
by: ruca | last post by:
Hi gurus, Can anyone tell me please when I really must setup the value of memory that aspnet_wp or w3wp must use in IIS server machine? What I mean is that we have clients that have diferent...
5
by: Frank Rizzo | last post by:
Hello, I have a very frustrating issue I've been working on. I have a routine that does the following: 1. Load a large (declared local to the function) DataSet from the database. It contains...
3
by: Sam Samson | last post by:
Can any-one recommend some good sites detailing how to code a simple memory profiler? How do they "look under the hood"? I built an uber simple service that tracks the process' memory but I need...
5
by: Max2006 | last post by:
Hi, What is the limit for memory that a .NET process or AppDomain can use? Thank you, Max
22
by: Peter | last post by:
I am using VS2008. I have a Windows Service application which creates Crystal Reports. This is a multi theaded application which can run several reports at one time. My problem - there is a...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.