Valhalla Legends Forums Archive | .NET Platform | Windows Forms Memory Consumption

AuthorMessageTime
Myndfyr
I've become very conscious about how much memory my bot uses (about 40mb by the time the bot loads).

I decided to do some testing:

Baseline (one window, no child controls):
      13,984k debug, 13,680k release

Baseline plus use of my library:
      14,336k debug, 14,200k release

Baseline console:
      6,580k debug, 6,356k release
Console plus use of my library:
      7,176k debug, 7,004k release

The "Baseline" test is an unmodified, brand-new C# project with a single, blank form called "Form1". Adding my library to it, I added a class which implemented the interface IConnectionSettings, which forced the runtime to load my library.

The "Baseline console" test was a brand-new console application. When I added my library to it, I implemented the IConnectionSettings interface on Class1, where the entry point was.

Somewhat scary....
July 21, 2004, 11:21 PM
St0rm.iD
Wow, that's really bad. Can you do the same benchmark on a native API Windows app, and MFC?
July 22, 2004, 3:10 AM
Maddox
My native C++ bot runs under 300K when idle sometimes.
July 29, 2004, 5:01 AM
hismajesty
Since iago is off camping..."JavaOp takes 600k"
July 29, 2004, 2:19 PM
iago
As long as I'm not using a gui, I've seen my Java bot as low as 300k and as high as 1.2mb, but it tends to level off at about 600k :D
July 29, 2004, 7:20 PM
LW-Falcon
The lowest I got with Armabot was 13mb after leaving it on for a day, then soared all the way to 80mb when I used the log viewer :-\
July 30, 2004, 6:49 AM
Myndfyr
[quote author=Falcon[anti-yL] link=board=37;threadid=7805;start=0#msg73340 date=1091170148]
The lowest I got with Armabot was 13mb after leaving it on for a day, then soared all the way to 80mb when I used the log viewer :-\
[/quote]

Is that all? I've had well over 100mb when using the log viewer. :-P
July 30, 2004, 5:00 PM
LW-Falcon
The log viewer took so long to view so instead of watching its memory usage increase I just ended the process. I had TFT minimized so all that memory consumption lags up my sister :( I'm sure If I had left it on it would've went over 100mb ;)
July 30, 2004, 5:24 PM
St0rm.iD
That's TERRIBLE!
July 30, 2004, 8:16 PM
TheMinistered
Hey, myndfyre-- what project configuration were those tests done on? If you set the configuration to Release, you will get better memory consumption, it's still bad-- but it's better.
August 3, 2004, 2:14 PM
St0rm.iD
40mb is still unacceptible.
August 3, 2004, 3:23 PM
Myndfyr
[quote author=TheMinistered link=board=37;threadid=7805;start=0#msg73869 date=1091542493]
Hey, myndfyre-- what project configuration were those tests done on? If you set the configuration to Release, you will get better memory consumption, it's still bad-- but it's better.
[/quote]

Emphasis added for people who can't read:

[quote author=Myndfyre link=board=37;threadid=7805;start=0#msg71742 date=1090452099]
Baseline (one window, no child controls):
13,984k debug, 13,680k release
Baseline plus use of my library:
14,336k debug, 14,200k release
Baseline console:
6,580k debug, 6,356k release
Console plus use of my library:
7,176k debug, 7,004k release
[/quote]
August 3, 2004, 5:45 PM
Myndfyr
[quote author=$t0rm link=board=37;threadid=7805;start=0#msg73878 date=1091546610]
40mb is still unacceptible.
[/quote]

Agreed. However, I think all things considered, 15mb is not. I am limited by the technology I am using; if its baseline is 14mb, then my goal is 15-18mb.
August 3, 2004, 5:46 PM
Tuberload
Yes, and it sounds like this technology is not so great right this moment.
August 3, 2004, 7:43 PM
TheMinistered
A base-line window uses ~6mb and base-line console uses ~5mb for me, perhaps your tests are faulty.
August 4, 2004, 2:15 AM
Myndfyr
[quote author=TheMinistered link=board=37;threadid=7805;start=0#msg73986 date=1091585708]
A base-line window uses ~6mb and base-line console uses ~5mb for me, perhaps your tests are faulty.
[/quote]

What runtime version?
August 4, 2004, 3:37 AM
K
on .NET 1.1, a debug System.Windows.Form uses 10mb for me, and a release ~7mb. I have 512mb of RAM, in case that's any way related.

Edit: I was about to test on 2.0 beta, but I haven't restarted since I installed it so I can't. And now I'm sleeping.
August 4, 2004, 3:37 AM
St0rm.iD
I'm a big hypocrite, using .NET, Java, and Python...but I think that bloatware is a HUGE issue.

Has anyone noticed Windows just slowing down after time? Even if you keep it spyware-free? I have a P3 550mhz box which is running win2k, and it can barely handle Opera.
August 4, 2004, 3:56 AM
LW-Falcon
My XP Pro has been running for about 2 weeks and I don't notice anything.
August 4, 2004, 4:05 AM
hismajesty
Alright, I've had a theory for a while that Microsoft didn't mind the memory consumption when developing .NET because, a few years down the road 500gb harddrives will be normal, >=1gig ram, etc. Just look at history, 10 years ago people had 4mb of RAM, even 4 years ago computers were still being built with 5 gb harddrives. Now people have 256-512mb shipped with stock computers, and 60-120gb harddrives.

Anyway, I've been conversing with Robert Scoble through email for the past month and I decided to ask him about my theroy, I'm assuming it's pretty close to the real reason. Here was his reply:

[quote]Yeah, that's sorta how Microsoft's developers think. They look at what the hardware is going to look like in three years and they develop features that'll take advantage of that hardware (and give them productivity so they can develop things in less and less time).[/quote]
August 4, 2004, 5:32 AM
St0rm.iD
[quote author=Falcon[anti-yL] link=board=37;threadid=7805;start=15#msg74011 date=1091592327]
My XP Pro has been running for about 2 weeks and I don't notice anything.
[/quote]

Mine for 2 months.

I'm talking about a P3 550mhz that I bought 3 years ago. It ran all of its apps and such perfectly fine. I reformatted and installed the same apps....and now it's slow.
August 6, 2004, 4:01 PM

Search