473,387 Members | 1,834 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,387 software developers and data experts.

Memory usage problems

I have a program with a couple datasets and a minimum number of controls.
The main form is a MDI container. The problem is that when the program
loads the memory in the working set shows 49 MB. If I minimize the
application and then restore it the usage drops to 9 or 10 MB. I have tried
everything to get the same result without ticking off a user by minimizing
and restoring evertime something happens in the application. What am I
missing? What does the program do when it's minimized that I can replicate
in code without minimizing?

Any help is appreciated.
Nov 20 '05 #1
2 1227
Gene,

What you describe seems to me the wished behaviour from the managed code. It
frees memory when it is needed or when there is idle time and it let it stay
when there is enough memory. Result is that the processing goes on and the
computer is not spending time with useless cleaning.

However when you have real memory leaking. (It is never set to lower) than
you can look to this what Rich was feeding back to the newsgroup last week.

Before his investigation I had never heard of that problem.

http://www.google.com/gr************...TNGP12.phx.gbl

I hope this helps?

Cor

Nov 20 '05 #2
Thanks for the link. I found a few other mentions on the subject as well.
I found some code (VB) to reduce the Working Set to a minimum number as is
done when the app is minimized. I'm not real comfortable with it since this
writes out to the hard drive virtual mem to clear the memory but may put it
in as a flagged function if the WS reaches a large number during runtime.
Code:

Private Declare Auto Function SetProcessWorkingSetSize Lib "kernel32.dll"
(ByVal hProcess As IntPtr, _
ByVal dwMinimumWorkingSetSize As Int32,ByVal dwMaximumWorkingSetSize As
Int32) As Int32

Public Function SaveMemory() As Int32
Return _

SetProcessWorkingSetSize(Diagnostics.Process.GetCu rrentProcess.Handle, -1, -
1)
End Function
End Function

Thanks again!
"Cor Ligthert" <no**********@planet.nl> wrote in message
news:O4**************@TK2MSFTNGP10.phx.gbl...
Gene,

What you describe seems to me the wished behaviour from the managed code. It frees memory when it is needed or when there is idle time and it let it stay when there is enough memory. Result is that the processing goes on and the
computer is not spending time with useless cleaning.

However when you have real memory leaking. (It is never set to lower) than
you can look to this what Rich was feeding back to the newsgroup last week.
Before his investigation I had never heard of that problem.

http://www.google.com/gr************...TNGP12.phx.gbl

I hope this helps?

Cor

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: ianstirkcv | last post by:
Hello, I wonder if you can please help… We are running a web application built using .net framework version 1.0, service pack 2, running on Windows 2000 server, service pack 3. The server has...
5
by: Justice | last post by:
Currently I'm doing some experimenting with the XMLHTTP object in Javascript. Now, the XMLHttp object is asynchronous (at least in this case), and the following code causes a significant memory...
5
by: DLPnet | last post by:
Hello, I m working on Windows and Mac in C++. My application uses a lot of memory since it s dealing with a lot of images. So I load images in a cache when needed and if I haven t enough...
6
by: Ganesan selvaraj | last post by:
I using C# .net. i want to split the text files based of the some condition. my source text file size may be 4 kb to 4 gb. some time when i split the i got the "out of memory exception. when i...
7
by: Jon Trickey | last post by:
We migrated to 8.1 from 7.2 this weekend. Everything ran ok over the weekend, but we have a light user load then (about 200 users.) Today when we had close to 600 users connecting and running...
8
by: Greg Merideth | last post by:
I've written a basic windows service to provide some helper xml functions for my web methods and even thou the service is only about 1k lines long with 1 timer, its mem usage is 10m and its vm mem...
16
by: JCauble | last post by:
We have a large Asp.net application that is currently crashing our production servers. What we are seeing is the aspnet_wp eat up a bunch of memory and then stop unexpectedly. Does not recycle. ...
3
by: Jeff | last post by:
I've been working on an application for a while now that has been giving me some trouble when it comes to working with a picturebox and memory usage. My company deals with digital imaging, so we...
9
by: jeungster | last post by:
Hello, I'm trying to track down a memory issue with a C++ application that I'm working on: In a nutshell, the resident memory usage of my program continues to grow as the program runs. It...
13
by: Ilias Lazaridis | last post by:
How to detect memory leaks of python programms, which run in an environment like this: * Suse Linux 9.3 * Apache * mod_python The problem occoured after some updates on the infrastructure....
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.