Jump to content
Sign in to follow this  
TheCuz

Compiled program size

Recommended Posts

TheCuz

Not sure if this is the correct place to post this but here it goes....

The program that I made has a compiled size of 114K, but when I start the program and look at it in task manager (on a NT4) it says it is taking 2.5MB of memory. How can this be?


[font="Verdana"]People who say it cannot be done should not interrupt those who are doing it. - George Benard Shaw[/font]

Share this post


Link to post
Share on other sites
Valik

You can't honestly think that the size on disk is any indication of how much memory a program will use when running. I can write a 2KB application which will use 500 MB of RAM.

Share this post


Link to post
Share on other sites
herewasplato

...compiled size of 114K, but when I start the program and look at it in task manager (on a NT4) it says it is taking 2.5MB of memory.

It has been a while since I've used NT4, but I seem to remember that task manager has the column that shows the Virtual Memory usage (VM Size) turned off by default... you might want to turn that column on and take a look at what some other programs do to your RAM and VM. [see menubar > view > select columns.]

On XP, Notepad is about 69,120 bytes (or about 68KB) and yet it takes up about 2MB RAM and about 1MB VM with no text in it. Add some text; say, about 150000 characters via several copy/paste operations and the RAM/VM usage goes up.

I cannot offer you an explanation as to why, I just wanted to assure you that most (if not all) programs do this. If want to have some fun (okay, so our definition of fun may differ) run this script:

Dim $a[16000000]
Dim $b[16000000]
Dim $c[16000000]
Dim $d[16000000]
Dim $e[16000000]
Dim $f[16000000]
Dim $g[16000000]
Dim $h[16000000]
Dim $i[16000000]
Dim $j[16000000]
Dim $k[16000000]
Dim $h[16000000]
Dim $i[16000000]
MsgBox(0,"AutoIt","RAM/VM")
Watch the row of info within task manager for AutoIt or if you complied it - that row.

[size="1"][font="Arial"].[u].[/u][/font][/size]

Share this post


Link to post
Share on other sites
TheCuz

Thanks for at least some attempt herewasplato, I apperciate the effort. At least it wasn't condescending.


[font="Verdana"]People who say it cannot be done should not interrupt those who are doing it. - George Benard Shaw[/font]

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.