Quarter Life Crisis

The world according to Sven-S. Porst

« Der UntergeherMainSearcher or Browser »

Dynamic Pager

631 words

With my notoriously scarce hard drive space and my inability to delete songs from my iTunes library (as this is both hard from a decision point of view and from a technical point of view as iTunes will let you delete songs which may be in one your numerous playlists, thus destroying them in the process), I am constantly seeing that warning dialogue that I’m low on disk space. I also have to restart my computer at least once a week to clear up the swapfiles which seem to accumulate.

Looking at the swapfiles as they are generated, it seems that they increase in size as time goes on. 64MB, 128MB, 256MB, 512MB, those are frequently seen in my /var/vm folder. When the computer has run for a long time, there’ll also be a 1GB file. And none of these likes to go away as quickly as I want it to. Even when quitting all applications or logging out at most the largest one will go away, even though the system shouldn’t need all that memory.

With the size of the swap files doubling in X.3 this can quickly fill up whatever little space there is left on my hard drive and cause all kinds of problems, such as applications trashing their preferences files because they don’t make sure they can actually write them. Look as far as Mail for a particularly bad example which loses the read/replied/whatever information for messages in mailboxes you manipulated along with the most recent deletions of messages in such a situation without warning. Look at NewsFire for a close second for losing all sorts of information in such situations although I’ve seen similar problems in other newsreading applications when I still used them. Indeed many Cocoa apps seem to be troubled by this.

Those erroneous behaviours are at least annoying but more like fully fledged bugs as they do destroy some of your data. To see how this can be handled in a better way you don’t need to look further than iTunes which puts up a dialog telling you about the disk space problem and that you may not be able to save future changes (this isn’t perfect as the music stops playing after finishing the current song while the dialog is open, but it doesn’t hurt your data).

One way to improve this situation would be to have smaller swap files like X.2 had and to be able to force the OS to make them go away or consolidate them to a few ones. Looking around the internet suggested that you can actually do this by changing your /etc/rc where the dynamic_pager which does the swapfile work is called. Its options can be learned on it manual page and you can set a couple of numbers for it. While the internet offers a couple of sets of numbers for this, they seem to be quite different. So I am wondering which combinations of numbers make sense and what the tradeoffs with respect to hard drive space or speed are. What exactly do those ‘high’ and ‘low’ watermarks mean?

I think I got it a bit wrong on my first try, typo or something, perhaps causing no swapfiles to be generated. At least /var/vm remained completely empty and I was surprised how many apps I could launch without any swapfile popping into existence. At some stage the system went into a constant hard-drive-access frenzy along with an always spinning rainbow beachball of death. So I restarted the computer forcefully after a few minutes. In a way that was an encouraging experience, though, as it suggests that I can get quite far with 640MB of RAM alone. I’d just want to avoid the crashing part in the future and that’s why I’ll appreciate any hints.

April 19, 2005, 1:32

Comments

Comment by Nicholas Riley: User icon

MemoryCell is quite good for monitoring memory usage/leaks in individual applications; when you see the memory usage spike, restart the app and you’re less likely to have problems.

http://www.rogueamoeba.com/freebies/

April 19, 2005, 4:53

Comment by ssp: User icon

I really think it’s more a problem of the virtual memory system that I’m struggling with that that of certain applications. I’ve seen this behaviour of OSX accumulating much more swapfiles that I’d like it to for ages and on different machines as well.

I don’t see how MemoryCell helps me manage the memory on my machine. It’s good to have an application that gives a sane number, but how can I see which application causes which swapfile to stay around? And how can I kick the OS to clean up all these files?

April 19, 2005, 9:42

Comment by perry: User icon

You can move your swapfile to another partition,or run daily task(built in or maybe you disabled it),I am not sure about this but I’ve seen it on my laptop.

June 9, 2005, 21:28

Add your comment

« Der UntergeherMainSearcher or Browser »

Comments on

Photos

Categories

Me

This page

Out & About

pinboard Links

♪♬♪

Received data seems to be invalid. The wanted file does probably not exist or the guys at last.fm changed something.

People

Ego-Linking