Memory Manager

Arg81

Well-known member
Joined
Mar 11, 2005
Messages
949
Location
Midlands, UK
Programming Experience
1-3
Hi Guys,

Is there any 3rd party apps, or can anyone help, with how my program uses memory.

Now I've just got my head around programming windows forms, but it's a whole new ball game for debugging...its all gone over me head...

Basically, when my app opens, it says it's using 9Mb. Then a form opens, 22Mb, then I open a Crystal report - 42Mb...

That's a hell of a lot of memory usage, isn't it?

cheers!
Luke
 
if your form is 22Mb then you must hundreds of thousands (literally hundreds of thousands) of things like buttons, labels, textbox's

22kb sounds more normal
 
Hey,

Are you checking your memory usage through Task Manager?
If so 42 MB (Don't quote me on this!! and people if I'm wrong please argue!!) seems about right. Most of my windows app written in VB.NET appear on task manager as being around the 40MB mark (I too was very worried about this at one stage), because of some strange things the .Net framework does. However take a look what happens in task manager when you minimise your app then maximise. I can't advise any other software you can use, but for .Net apps task manager is not a reliable indicator. I've read somewhere that the .Net framework actually reserves as much memory as it can to begin with then releases it as necessary, no idea if this is true. As a side note, for a test try creating an application with one button which brings up a message box saying hello world. Run it and check task manager, its quite suprising!
 
Actually if you run the app in debug mode it can consume even much more than 22MB in some cases. but, the real memory usage should be taken after you compile the app and i suppose it should be not even nearly 22MB. Also, it is normal if you have multiple program running.

BadgerByte, you are right about Taskmanager ... it is not a reliable indicator but it cannot miscarry for more than of 5% in my opinion. So, with that in mind you must agree that it is not normal that compiled app is consuming so much memory ... :)

But, Luke you shouldn't worry as much ... to approve my claiming you can make a comparation, just open two instances/windows of IExplorer and you'll see that it takes about 50MB :D that is far more than your app. With 2GB RAM (in my case) it doesn't matter tonnes, but it is still a lot

However memory is very cheap these days so free up your mind from 'having' to think about memory. btw, did you know that new windows vista "Aero Glass" (old longhorn) requires 1GB memory to be installed and for optimal work it asks for 2GB RAM ... SATA 2 HD etc.

Regards ;)
 
Last edited:
Yeah, I was looking at task manager.

My reasoning behind this is as follows....

My app is going to be installed on a server (2Gb) running terminal services. The desktop / laptop computers that need access to the program will then have a configured terminal session setup that opens the app immediately - therefore all of the work is done on the server and not on the PC's.

However, there are going to be about 15 at max using the app. I saw it as 15 * 50Mb = 750Mb memory used in total just for the app at most!
 
Hey,

I've been worried about this for some time too. However I just performed a test, creating a single form app with one button which when pressed brings up a message box. Compiled in release mode and run from the IDE this takes up roughly 15,000K. Run from it's exectable it still takes up around 7,000K. When the Message Box opens this jumps to 8,000K and does not return to 7,000K when the box closes. Give it a whirl!
Do you get the same results? or am i doing something very wrong!!!!
 
Hey Badger - something you obviously haven't come across yet - Garbage Collection.

I've learnt a bit about it the last couple of days, but it's all going above my little brain.

Basically when an object or whatever is disposed, it isn't released from memory. From time to time .Net will run a garbage collection and release any free memory. This however isn't set in stone. I opened and closed a form and after waiting 20 minutes, no memory was freed up.

You ain't doing nought wrong, I get the same, and I bet everyone else does. At first I thought .Net was one of those programs where the more phyiscal memory you had installed, the more it used. But I installed my app on a PC running 256mb RAM and it still takes up 40Mb when opening forms and reports.
...This is stage 1 of the project, stage 2 will have about 40 forms and 50 reports - god knows how much memory that'll take up then!!!

Luke
 
Back
Top