Why do apps use so much memory?

alra111

Registered
According to my Activity Monitor, the Calculator DashboardClient is using 6.45 MB of real memory and 338.36 MB of virtual memory. Why does a calculator program need all that memory?

It seems that as memory sizes are growing, even simple little programs are becoming bigger and bigger memory hogs.

Alra111
 
I'm not really sure, but I would imagine that it's to do with all of the extra stuff that's in an application's framework. For example, a calculator doesn't just need simple arithmetic and a picture for each button etc, it also needs all of the code that allows it to interface with the window manager and the hundreds of other components inside the system.

Also, a classes in a programming architechture such as Cocoa for example contain much more functionality than is used in such applications. I'm not sure how these classes are compiled, but it wouldn't surprise me if there is a huge amount of memory being used to store data that is never even used.

Just a guess,
Tom
 
my itunes is currently using 96mb ram on my 2gb ram G5, whereas on my 640mg iBook G3, it uses a lot less.

i think OSX's memory managemnt allows programs to spread around, until it's need somewhere else. also, Calculator uses brushed metal, which is a shaded texture (it is rendered flexibly - it's not a prefixed look), which may account why it's a bit more resource hungry than a calculator should be...
 
"...even simple little programs are becoming bigger and bigger memory hogs."

I've had a similar question a couple of days ago, but unfortunately no reply so far... can't believe the memory usage of this small app... here's my original post:

"I've noticed that running iSafe Light (password keeping program) is using up a lot of the CPU. % is showing anywhere between 65 and 75 in my activity monitor, while other programs are much less, e.g:
Google Video Player - 5.2
Word - 2.6
Bon Echo - 1.5
and so on....
Is there anything wrong with the application? I thought its just a safe place to keep my passwords and serial number info... should I be concerned?"
 
"I've noticed that running iSafe Light (password keeping program) is using up a lot of the CPU. % is showing anywhere between 65 and 75 in my activity monitor, while other programs are much less, e.g:
Google Video Player - 5.2
Word - 2.6
Bon Echo - 1.5
and so on....
Is there anything wrong with the application? I thought its just a safe place to keep my passwords and serial number info... should I be concerned?"
Yep, that app is broken, there’s no way it should be using that much CPU, especially if it’s idle. You should send a note to the developer.
 
"...You should send a note to the developer."

I did:

"...thank you for the information you have provided us. The issue could be caused by rosetta emulation because iSafe is not native to the intel chip set used in your Macbook Pro. However we will be looking into this issue to see what is possible to reduce the CPU load and will release an update to resolve this issue."
 
Well, Dashboard widgets are memory hogs because each one is like its own dedicated web browser.

But all OS X apps use quite a bit of RAM compared to the way things were in OS 9. I'm still not entirely sure why this is. Part of it surely has to do with the fact that unlike in OS 9, every app in OS X has its own protected memory space, and operates in its own largely-isolated environment. That means that where applications would share memory in OS 9, each app might have its own copy of that memory in OS X. This is a good thing; it keeps applications from stepping on each other's toes and it's what makes OS X darn near uncrashable.

That's certainly not all there is to it, though. I'm sure OS X's GUI plays a role. Every window in OS X is double-buffered and composited on the fly, which costs some RAM and CPU power but gives us cool things like Exposé. There are a lot of features like this built into OS X, and everything is a tradeoff.

Of course, sometimes the applications really are just not as efficient as they could be. Developers take the power they're given and they use it. In some cases, they use it to make their lives easier, resulting in less efficient programs that take a lot less time and effort to make. Again, it's a tradeoff. I doubt we'd have nearly as many cool programs as we do if software development were as hard as it once was.

But again, I'm not sure what all the reasons are. These are just a few, and I can't begin to say how they weigh against each other in practice. It still bugs me that an app that uses 1-2MB in OS 9 uses 15MB in OS X, but I've come to terms with the fact that the rules have changed.



As for the large "virtual memory" sizes, that's sort of a non-issue, since a lot of that IS shared. For example, right now Activity Monitor reports 6.75GB of VM usage, while my actual VM swap files total only 1GB. The more apps you have loaded, the larger this discrepancy will be. The virtual memory usage reported by Activity Monitor and the like are only really useful for developers debugging their apps, I think.
 
Interesting... thanks for the advice, I was wondering what was going on...
An app which performs such a simple function should have a minimal footprint, both memorywise and CPU.

I use Yojimbo which has a password vault and much more. I’ve never actually seen it consume any more than 3.5% CPU and that’s very, very briefly. It uses nothing when it’s idle and that’s the way it should be.
 
Back
Top