473,651 Members | 2,645 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

memory usage of .net application

Hi,

I notice if I run my application, the Windows Task Manager
shows the application using around 20MB of memory.

However, after I minimized the application and
maximize/restore the application again, the memory usage
dropped to around 5MB.

It seems like only after startup, it uses up to 20MB of
memory and after you minimize it, the memory usage drops.

Anybody knows why this happens? and Is there anyway to
have the program start running with memory usage of 5MB?

Thank you in advance.

regards,
Sean
Nov 16 '05 #1
2 1714
Well, you could do a trick.

In your form's Load event add these lines

this.WindowStat e = FormWindowState .Minimized;
this.WindowStat e = FormWindowState .Normal;

The side effect is that it will give the illusion of starting from the taskbar, but will release unused resources used during form creation, or trigger the garbage collector, not sure which.

--
Happy coding!
Morten Wennevik [C# MVP]
Nov 16 '05 #2
sean <an*******@disc ussions.microso ft.com> wrote:
I notice if I run my application, the Windows Task Manager
shows the application using around 20MB of memory.

However, after I minimized the application and
maximize/restore the application again, the memory usage
dropped to around 5MB.

It seems like only after startup, it uses up to 20MB of
memory and after you minimize it, the memory usage drops.

Anybody knows why this happens? and Is there anyway to
have the program start running with memory usage of 5MB?


It sounds like you're just going by what task manager is showing, which
is just the working set. There's been a lot of discussion about this in
the newsgroups - do a groups.google.c om search on the .NET newsgroups
for "working set" and you'll get loads of hits.

--
Jon Skeet - <sk***@pobox.co m>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 16 '05 #3

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

Similar topics

3
5777
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 1 gigabytes of RAM. We are using Perfmon to monitor memory usage of aspnet_wp.exe, CPU usage, and % time in the Garbage Collector.
6
3271
by: Tom | last post by:
We have a VERY simple .NET C# Form Application, that has about a 23MB Memory Footprint. It starts a window runs a process and does a regular expression. I have done a GC.Collect to make sure that, no memory is lying around. GC reports only 84k of allocations. Starting 5-10 of this apps is going to start taking a considerable amount of memory. Is there a way to reduce this? Tom
20
4214
by: Philip Carnstam | last post by:
How come .Net applications use so much memory? Every application I compile uses at least 10 MB of memory, even the ones consisting of only a form and nothing else. If I minimize them though the memory usage drops to a couple hundred KB. Why? Is there anything I should to to prevent this? I have compiled in release and deactivated all forms of debugging, I think! Thanks, Philip
16
2382
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. Example: After about 5 hours with a concurrent user base of about 150 users the application raises the aspnet_wp memory usage by almost 500MB. If our server guys modify the web.config this data is released and the workerprocess goes back to a...
4
3901
by: Ethan Chan | last post by:
I have recently been deploying a asp.net extranet application. The asp.net worker process starts off with 30MB virtual memory and then upon serving a few pages, the memory usage increases to a WHOOPIN! 200MB and eventully the asp.net process restarts at 300MB and my application becomes "unavailable" with my sessions being destroyed. Is there an explanation why the asp.net process uses that much memory? After i have logged out of my...
3
3522
by: san | last post by:
we cannot stop the application from increasingly use memory. The CRM Worker process will continually consume memory but not release it back to the system. Please research into how to make the application consume less memory or at least release the memory when it is done processing a request. It seem like you can be logged in for any amount of time without an issue, I've been told you shouldn't be logged out until idle for 2 hours but...
17
5696
by: Frank Rizzo | last post by:
Hello, I've compiled my app for AnyCPU setting in vs2005. Then I tried the app on both 32-bit Windows 2003 R2 and 64-bit Windows 2003 R2. The memory usage of the application when working on the same data set were unbelievable (the data is from Task Manager) : 32-bit Windows 2003 R2 Mem Usage: 481,400k Peak Mem: 583,020k
10
6677
by: Daniel Peterson | last post by:
I'm responsible for a pair of IIS 6 webservers that run our production ASP.Net application. We push code on a monthly basis, and about two weeks after our October code push, we started to run into occasional webserver errors. The application pool is configured to run as a domain user which has permissions to the web code. When we have issues, the webserver will return the ASP.Net "Server Application Unavailable" page, and our app pool...
22
9331
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 memory leak someplace. I can not detect the memory leak by running several reports by hand, but when I run tha app as a servrice and process few hundred reports there is significant memory leak. The application can consume over 1GB of memory where it...
2
4107
by: manojmohadikar2008 | last post by:
Hi All, We are observing a serious issue with the memory usage of Queue and its very critical issue which needs to be fixed. We have an application which runs two threads i.e. a Producer and a Consumer thread. The Producer thread (Enqueue) inserts some heavy user defined object in the Queue. The Consumer thread (Dequeue) deletes one object from the Queue and processes it. When we monitored the memory usage of this application in Task...
0
8349
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8795
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8695
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7296
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5609
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4143
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4281
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2696
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1585
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.