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

Memory management Question.

Hello,

I have a small VB.Net application that instantiates many objects (about
200), when I look at task manager the application is using about 50 meg.
Now if I minimize the window then restore it the memory usage goes down to
about 8 meg then after a while it will go up to about 15 meg. Does anybody
know why the app behaves this way and how I can make my application only use
8 to 10 meg, as it does when minimized, at startup?

Thanks,
Rob Panosh
Advanced Software Designs.
Nov 20 '05 #1
2 965
* "Rob Panosh" <ro************************@asdsoftadfdware.com> scripsit:
I have a small VB.Net application that instantiates many objects (about
200), when I look at task manager the application is using about 50 meg.
Now if I minimize the window then restore it the memory usage goes down to
about 8 meg then after a while it will go up to about 15 meg. Does anybody
know why the app behaves this way and how I can make my application only use
8 to 10 meg, as it does when minimized, at startup?


This behavior is not specific to .NET applications only.

It is a feature of the Windows/Explorer shell.

If an application is minimized, Windows removes the working set memory from
the application by calling the Win32 function 'SetProcessWorkingSetSize':

<http://msdn.microsoft.com/library/en-us/dllproc/base/setprocessworkingsetsize.asp>

Windows supposes that minimized applications will not be used for some time
and this memory will be made available to other processes.

When restoring the window the application gets the memory back:

<http://support.microsoft.com/?kbid=293215>

This behavior is by design and it doesn't make sense to worry about

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>

<http://www.plig.net/nnq/nquote.html>
Nov 20 '05 #2
Good Reply Herfried,

I didnt know that !

OHM


Herfried K. Wagner [MVP] wrote:
* "Rob Panosh" <ro************************@asdsoftadfdware.com>
scripsit:
I have a small VB.Net application that instantiates many objects
(about 200), when I look at task manager the application is using
about 50 meg. Now if I minimize the window then restore it the
memory usage goes down to about 8 meg then after a while it will go
up to about 15 meg. Does anybody know why the app behaves this way
and how I can make my application only use 8 to 10 meg, as it does
when minimized, at startup?
This behavior is not specific to .NET applications only.

It is a feature of the Windows/Explorer shell.

If an application is minimized, Windows removes the working set
memory from the application by calling the Win32 function
'SetProcessWorkingSetSize':

<http://msdn.microsoft.com/library/en...ssworkingsetsi
ze.asp>
Windows supposes that minimized applications will not be used for
some time and this memory will be made available to other processes.

When restoring the window the application gets the memory back:

<http://support.microsoft.com/?kbid=293215>

This behavior is by design and it doesn't make sense to worry about

Nov 20 '05 #3

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

Similar topics

9
by: Rafael Charnovscki | last post by:
I can comprehend the basics of that subject (pointers, memory allocation, heap, stack etc), but I am interested to have references with more details. I have some C/C++ books and lots of URLs...
7
by: Dan Nilsen | last post by:
Hi! I'm writing a small piece of software that basically runs on an embedded system with a Power-PC cpu. This runs on a stripped down version of Linux - Busybox. As I'm writing a piece of...
8
by: Chad | last post by:
hello, i am losing memory each time i make this call to a C++ dll (I make frequent calls). 'in VB.Net Declare Function grab Lib "grabber.dll" _ (ByRef lpBuf As Byte, ByVal lnum As Integer)...
1
by: trialproduct2004 | last post by:
Hi all, I am having slight confusion regarding memory management in .net. Say suppose i have two application one is in C# and other is in MFC(VC++). Both of this application are using lots...
13
by: Vijay | last post by:
Hi All, I am learning C++ and have one question. Using free or delete we can release the memory. After releasing memory where this released memory will go.. Does it go to back operating...
3
by: Jim Land | last post by:
Jack Slocum claims here http://www.jackslocum.com/yui/2006/10/02/3-easy-steps-to-avoid-javascript- memory-leaks/ that "almost every site you visit that uses JavaScript is leaking memory". ...
9
by: benoit808 | last post by:
I don't have a lot of experience with C++ so I apologize if this is a stupid question. I use Paul Nettle's memory manager (mmgr.cpp) which reports a memory leak but I don't think there's one. Here...
3
by: Indian.croesus | last post by:
Hi, Going through previous posts, apparently the memory management is not something that the standard C defines. I have read various posts and the word compilers and OS implementations have been...
34
by: jacob navia | last post by:
Suppose that you have a module that always allocates memory without ever releasing it because the guy that wrote it was lazy, as lazy as me. Now, you want to reuse it in a loop. What do you do?...
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...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.