tags:

views:

127

answers:

5

Hi, I was just curious I have a binary executable file in unix around 9MB. is that considered a large memory footprint? the client will be calling this to generate some values and subsequently queue messages elsewhere. I am just curious who is one suppose to know how when is it too big a memory footprint for a program and then having to provide like a static library instead of an executable?

+1  A: 

It all really depends on how much value you get for that 9MB. For example if the file added a few numbers then definately too large. However 9MB isn't really all that much these days where a server can have over 8GB of memory easily.

For comparison just starting some VM's can use over 50MB of memory.

thomasfedb
I think OP was curios about the _executable_ size, not about the memory usage
sum1stolemyname
+5  A: 

Everything is relative. It's large footprint if the app is running on a machine with 8MB of RAM. It's not large if the app is running on a machine with 64GB RAM. Then again, it might be large even on a 64GB RAM machine if most of the RAM has been gobbled up by some huge Oracle instance (for example).

You should also take into account that only a part of those 9MB is actually loaded into RAM -- readelf or objdump utilities can show you how much exactly.

zvrba
+1  A: 

Back in 1996 I was routinely creating executables (staticly-linked) for a top-tier CAD/CAM vendor that routinely ran between 32 and 50MB in size, depending on the platform. Yes, back when memory was $40 per MB, we managed to fill up a system with our program. In 1996. In light of that, everything I see today wrt software bloat pisses me off, because that program did more on startup than most do in their whole day. :-)

So no, unless it's "helloworld.exe", 9MB isn't much these days.

Chris Kaminski
yea it just seems like it would be easier for some to use a static lib. but i had deployed this executable because one we did not want to share our code per say at all and two the larger client wanted it that way and so it worked out. however a smaller client who would be doing the same thing as the larger client simply wanted it as a static lib because it would be easier for them however to avoid more development/testing and maint issues further down the road I am sticking to my guns and asking them they just make external calls to the executable to get what they need.
djones2010
A: 

I have 1.5TB of hard drive space. I can fit 174762 copies of that binary on my disk.

As for ram, perhaps if there was 9MB of code in that binary (which I highly doubt), then maybe it will all be kept in ram.

Otherwise, the executable loader will probably only load the parts it needs, if there are some resources or unmapped parts of the binary they aren't necessary to be kept in ram for the whole runtime. In any case, you probably have at least 1-4GB of ram, so it's clearly not a problem...

Longpoke
+1  A: 

That sounds pretty normal. You could hit 9MB quickly by statically linking to various libs, or by enabling debugging symbols.

John