473,394 Members | 2,002 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,394 software developers and data experts.

Memory usuage

Hey Group,
I just found that the memory usuage for my .NET windows application drops
significantly whenever I minimize my application. Also I noticed when I
maximize the application again, the memory usuage increases but it is stilll
a lot less than what it was intially (when the program initially loaded). I
would like to know the reason behind this behavior. Also I would like to
know whether it would be possible to mimic this behavior through user code.
Any suggestions/advice in this will be greatly appreciated.
Thanks,
Bhargavan
Nov 16 '05 #1
3 1375
Are you sure you are seeing the total amount of (virtual) memory that
the application is using, or just the amount of real memory it is
currently occupying?

Minimized applications are often swapped out of memory to the swap
file, because the application is not running and does not need to
access its memory, so Windows frees up real RAM for use by active
applications.

However, the application is still using all of the virtual "memory" it
did before: parts (or all) of its image are simply in the swap file.

When you maximize the application again, Windows swaps back into "real"
memory (RAM) only the bits of the application's memory footprint that
it actually tries to read, leaving the rest in the swap file.

I believe that what you're seeing is an artifact of the way that
virtual memory works, not any real reduction in the amount of memory
that your application requires.

Nov 16 '05 #2

"Bhargavan" <bh********@yahoo.co.in> wrote in message
news:uW*************@TK2MSFTNGP15.phx.gbl...
Hey Group,
I just found that the memory usuage for my .NET windows application drops
significantly whenever I minimize my application. Also I noticed when I
maximize the application again, the memory usuage increases but it is
stilll a lot less than what it was intially (when the program initially
loaded). I would like to know the reason behind this behavior. Also I
would like to know whether it would be possible to mimic this behavior
through user code. Any suggestions/advice in this will be greatly
appreciated.
Thanks,
Bhargavan


This is a FAQ. Here's an explanation of this process:

http://support.microsoft.com/default...b;en-us;293215

David
Nov 16 '05 #3

When you minimize an application the process is reduced to it's minimal
working set (because the OS thinks you won't be using the application for a
"long time"), by writing R/W data pages to the paging file and throwing away
Read only pages. Whenever your application gets activated you will incur a
lot of hard page faults, because the data pages must be brought back into
memory (when needed). The resulting WS will in general be less than before
because some pages aren't needed anymore, for instance because they were
only needed to initialize a context.
Now it's possible to reduce the working set of YOUR own application, but
this is realy a very bad idea. The system will trim the WS of all
application when there is memory pressure (lack of), in a far better way
than it would do when you force the OS to trim the WS of a single
application.
So please don't try to play the role of the Memory Manager, you simply don't
know how large your WS should be and you simply can't control which pages
should be removed.

Willy.

"Bhargavan" <bh********@yahoo.co.in> wrote in message
news:uW*************@TK2MSFTNGP15.phx.gbl...
Hey Group,
I just found that the memory usuage for my .NET windows application drops
significantly whenever I minimize my application. Also I noticed when I
maximize the application again, the memory usuage increases but it is
stilll a lot less than what it was intially (when the program initially
loaded). I would like to know the reason behind this behavior. Also I
would like to know whether it would be possible to mimic this behavior
through user code. Any suggestions/advice in this will be greatly
appreciated.
Thanks,
Bhargavan

Nov 16 '05 #4

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

Similar topics

31
by: lawrence | last post by:
I'm not sure how this is normally done, on a large site, perhaps one running Phorum. Occassionally a thread will have hundreds of entries, perhaps a meg or two worth of data. You won't necessarily...
22
by: xixi | last post by:
hi, we are using db2 udb v8.1 for windows, i have changed the buffer pool size to accommadate better performance, say size 200000, if i have multiple connection to the same database from...
8
by: lurker | last post by:
If a compiled exe project is under 400kb, why does it take up 15Mb when running? Is this normal? If not, how do I restrict the amount of memory it can consume? Secondly, does anyone have a bit...
3
by: Bhargavan | last post by:
Hi group, I have created a User control and whenever I use that usercontrol in a form, there is a memory leak. When I open and close the form, the form along with my user control is not disposed....
1
by: Cy Huckaba | last post by:
We are running our company website on a win2k server running .NET framework 1.0 and IIS 5. The pages consist of mostly static content built from a combination of custom controls (dll is only 148k...
0
by: llp | last post by:
We have a server which has about 90% memory usuage and it seems the cache is constantly being invalidated even though there is physical memory to use. On development machines it works fine but on...
3
by: garyusenet | last post by:
Some time ago I enquired about how I interface with a program written in an old version of C++ Any terms i use like list that follow are used in their common everyday usuage! One of the...
5
by: kumarmdb2 | last post by:
Hi guys, For last few days we are getting out of private memory error. We have a development environment. We tried to figure out the problem but we believe that it might be related to the OS...
3
by: Sonu | last post by:
Hello - I have the following code in my vb.net app and when it runs, the memory usage at the Windows Task Manager keeps increasing for the application and stops after a while. I'm using some...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...
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
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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,...

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.