User Name
Password
AppleNova Forums » Genius Bar »

Any way to cache an running app completely in swap space?


Register Members List Calendar Search FAQ Posting Guidelines
Any way to cache an running app completely in swap space?
Thread Tools
atomicbartbeans
reticulating your mom
 
Join Date: Jan 2005
Send a message via AIM to atomicbartbeans  
2006-06-14, 16:27

This problem stems from me only having 256 MB in my iBook, and I'd like to run Skype all the time, but it eats a lot of physical memory...



Skype is really useful for making calls, but it usually sits idle for hours at a time, wasting all that physical memory that could be used for things I'm actually working on.

I know if I open lots and lots of apps, the ones in the background get cached almost completely in swap space (virtual memory) in order to make room for the foreground app, and as a result a normally memory-hungry app (Skype for example) then takes up very little physical memory. Is there any way to invoke this; to have Skype automatically move to swap space on the hard disk when I close the window and -tab to another app?

To clarify, here's what would ideally happen: I launch Skype, but then close the window. I switch to Adium, Camino, etc. and Skype moves most of its physical memory usage to swap space on the hard disk, so as not to short-change all the other running apps. A few minutes later somebody calls me, so I move Skype to the foreground and it eats up its normal amount of physical memory again.

I know Skype is a closed-source app (the reason I didn't post this to Programmer's Nook), but there may still be a way to tweak its memory usage... ?

You ask me for a hamburger.
  quote
ghoti
owner for sale by house
 
Join Date: Apr 2005
Location: Charlotte, NC
 
2006-06-14, 16:35

As you can see, it only takes up 20MB of RAM, everything else is already in the swap space. AFAIK, you can't control this directly, but the parts of the program that are not used at the moment are swapped out/freed and reloaded from the executable on demand. Skype is quite a memory hog, unfortunately, especially for an "always on" application.
  quote
alcimedes
I shot the sherrif.
 
Join Date: May 2004
Send a message via ICQ to alcimedes  
2006-06-14, 17:07

I thought Skype, if left on, became a supernode of sorts and tried routing all sorts of traffic. Probably an app. I wouldn't be running all the time. Might want to buy more RAM too.

Google is your frenemy.
Caveat Emptor - Latin for tough titty
I tend to interpret things in the way that's most hilarious to me
  quote
Enki
Senior Member
 
Join Date: Nov 2004
 
2006-06-14, 17:14

While I don't run Skype and won't comment directly on it's hogginess, that screenie shows a small footprint of only 23.25MB. The Virtual Memory column doesn't neccessarily have anything to do with actual memory in use, that is the size of memory that is currently mapped in the memory subsystem. That means the 187MB may just be how much memory would be consumed if all the current addresses in the memory map were used, not how much is currently consumed. That number is almost always quite a bit larger than what is actually in use ay any point in time.

The OS plays these games so it can conserve how much real space is needed to keep track of the memory maps. So what the 187MB is really saying is you are using FAR less than the 4GB the program is entitled to and the OS is only currently doing accounting on the first 187MB of those 4GB. As those 187MB fill up with real information that VM size will expand in proportion until it hits the 4GB max space for a 32-bit machine or the 16 exobyte max on a 64-bit one. This is a good thing or you could fill 16GB of RAM plus more swap space with a single memory map for a single 64-bit process.

Also my guess is Skype is a hog when in use, but not so much when just waiting around. Even if the VM size balloons, it can be almost entirely empty after a call is completed as long as the program cleans up after itself nicely, something that cannot be determined by looking at VM sizes alone. If you want to play it safe, just quit and relaunch after a call is completed and things should stay cleaned out.
  quote
chucker
 
Join Date: May 2004
Location: near Bremen, Germany
Send a message via ICQ to chucker Send a message via AIM to chucker Send a message via MSN to chucker Send a message via Yahoo to chucker Send a message via Skype™ to chucker 
2006-06-14, 17:19

Quote:
Originally Posted by alcimedes
I thought Skype, if left on, became a supernode of sorts and tried routing all sorts of traffic.
Yes, but only if deemed appropriate based on available upstream/downlstream bandwidth, connection latency (ping time) and CPU time. These roles are allocated dynamically, so since abb's machine is a little bit on the low end, his Skype probably wouldn't do this.
  quote
atomicbartbeans
reticulating your mom
 
Join Date: Jan 2005
Send a message via AIM to atomicbartbeans  
2006-06-14, 19:40

Well yes Enki, I have no problems with the amount of swap space it's taking up... I'm only concerned about its physical memory use. It seems like a waste for it to be using 23+ MB when sitting there doing absolutely nothing... it doesn't seem to be acting as a node for others, because aside from web server traffic, my network meter is pretty stagnant when I'm not doing anything.

What I'd like to happen is for the app to move itself almost completely into swap space, and not be hogging all those 23 MB, when it's doing absolutely nothing.

You ask me for a hamburger.
  quote
Enki
Senior Member
 
Join Date: Nov 2004
 
2006-06-15, 11:59

Well even though it's using 23MB, nothing else is wanting to use it right now so it's not wasted. Just let the OS do it's job, if the OS needs the space to service another app, it will swap skype out as part of the normal virtual memory operation.

OS X is big on lazy execution, which means don't do stuff before it's actually needed. Statistically, that is the most efficient way to run an OS over the long term. Swapping things or performing other operations when you don't really need to leads to thrashing where a system spends almost all it's effort mucking about and not getting any actual work done.
  quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Post Reply

Forum Jump
Thread Tools
Similar Threads
Thread Thread Starter Forum Replies Last Post
Running Two Versions of the Same App InactionMan Genius Bar 7 2005-02-01 08:41


« Previous Thread | Next Thread »

All times are GMT -5. The time now is 20:37.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2019, AppleNova