Disk memory black hole! Something hidden writes to HD (Snow Leopard)

Joined
Aug 22, 2013
Messages
12
Reaction score
0
Points
1
Location
Spain
Your Mac's Specs
MBP (2009) 2.66GHz Core 2 duo; MacPro 2x2.8 Quad-core; iPad3 (retina)
After finding my MacBook Pro (2.66 Core Duo, 4GB RAM; 2009; OS 10.6.8 (Snow Leopard)) stuck in sleep yesterday morning, I restarted it the hard way (button press), only to find out it would not reboot beyond a visual OS shell and desktop, but with the mouse stuck in the left upper corner, showing the watch icon.
Because recently there had been an increase in kernel panics (high time to change RAM perhaps), and I had just before sleeping updated a system monitor shell (Bjango's iStat Menus), I decided to restart in safe mode first.

I'm not sure what's really wrong, the main symptoms at the moment are:
- Safe Mode runs extremely slow (screen refresh for, say opening a menu seems about 1Hz). Normal startup does not even result in anything running except a visual for the desktop, and menu bar with incomplete icon arrangement. Mouse works.
- Simple operations (opening a finder window, starting Activity Monitor) make 'something' start eat free disc memory. Fast. On startup (safe mode): 45GB free, but after 'just' opening Activity Monitor (which took ~7 minutes to do) and flipping through tabs for monitor, activity and system memory, free disc memory had dropped to 27.7 GB. Before shutting the machine down again, I checked that the trash bin was still empty, as it was.

What's eating/leaking memory, and where can I free that claimed memory back? How can I find out, eg. using another Mac (I'm at work, using a desktop with same 10.6.8) and the problem child just in target mode?

Using target mode, I managed to free up HD memory by moving & deleting files, delete some old cache, do a (successful) disc repair so far. But the black hole eats that memory just as well..

While watching activity monitor, I penned down some numbers:
Disc Usage: SystemUIServer ~8%CPU 1.78GB used; other processes much less.
Disc Activity: reads in/sec: 29-785; reads out I forgot to write down because then I noticed: data written 16.3 GB and increasing pretty fast; data read 2.33GB, looking stable.
System Memory:
Free ~8MB; Wired 1.45GB; Active 1.69GB; Page ins 315.7MB; page outs 5.90GB Swap 17.80GB (Those last guys look suspicious to me).

Thanks for any help!
 
OP
S
Joined
Aug 22, 2013
Messages
12
Reaction score
0
Points
1
Location
Spain
Your Mac's Specs
MBP (2009) 2.66GHz Core 2 duo; MacPro 2x2.8 Quad-core; iPad3 (retina)
Update:
After writing the above, I restarted the machine in safe mode, finding 50GB of HD free now, more than ever before! But opening activity monitor again cost me already 2GB to the 'black hole'.

from activity monitor this time:
Disc Activity:
reads in/sec 30-1147 (min.-max. watched over just a few seconds)
reads out/sec 44-209
data written 8GB when shutting down again, increase is indeed decrease in disc memory (down to 42GB on shutdown)
data read 2GB, stable
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
How much free space do have on your drive? It sounds like not very much, the system cant write cache files.
You need at least 10 to 20 percent free space on the boot drive for the system to work properly.
 
M

MacInWin

Guest
20% is much better than 10%, too.

EDIT: Also, just to keep the conversation from getting weird, "Storage" is the space on your Hard Drive. "Memory" is the RAM installed in the computer. It's a bit pedantic, but it is important to keep the terms straight. What Craig and I are trying to say is that when memory gets tight, the operating system writes out to the storage the contents of memory that is not actively being used, then reads that back in when it is demanded (that's called Swap). That's why you need a good bit of storage space on the hard disk or the in and out of that data gets slow. Under 20% disk fragmentation kicks in as a major factor, further slowing down the reads and writes as the heads have to move all over the discs to find open holes in the fragments for the data.

So, how big is the HD and how much free space is in it? And how much memory do you have installed? It was hard to see in your posts exactly, it looks like maybe 2GB.
 
Last edited:
OP
S
Joined
Aug 22, 2013
Messages
12
Reaction score
0
Points
1
Location
Spain
Your Mac's Specs
MBP (2009) 2.66GHz Core 2 duo; MacPro 2x2.8 Quad-core; iPad3 (retina)
20% is much better than 10%, too.
[...]
So, how big is the HD and how much free space is in it? And how much memory do you have installed? It was hard to see in your posts exactly, it looks like maybe 2GB.

Thanks for the help, and sorry for being unclear. 50.34GB free storage on a 320GB (319.73 measured). 4GB RAM memory installed.

From looking again at activity, Swap used increases steadily with about 0.04GB/sec, never dropping. I'm not running anything else under Safe mode than the activity monitor, even killed some processes to try make a difference (softwareupdatecheck, and quicklookhelper; none made a difference to the free storage drop).

Note also that I freed that amount of storage after everything turned slow, using target mode, by moving out whatever moderately big I could find. But most of them older files, i.e. ones in other storage sectors than the recently used ones. Before the problem occurred, I kept about 35GB free. In theory, those sectors should still be as free as they were, but i can't tell exactly which part of the now (at Safe mode startup) available storage is pre-crash, and which part is the result of my emergency moving post-crash. If I understand MacInWin's reply correctly, this means that the freed older sectors would not necessarily help the heads write Swap, as they are still fragmented over the whole disc.

Is there a way to control/ limit Swap as it looks to be unnecessarily writing but not freeing storage?
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Is there a way to control/ limit Swap as it looks to be unnecessarily writing but not freeing storage?

Install more ram. Then it will use very little swap if any. With 8 gig memory I'm using 1 gig swap on my laptop. On my imac with 16 gig I don't have a swap file (unless I run a LOT of apps at once).

As far as limiting swap, no, although I think you can turn it off if you're familiar with the command line. I seriously don't recommend it.
 
M

MacInWin

Guest
More RAM will definitely help. I'm running 10 Gig, no swapping going on at all. With Safari open, plus Activity Monitor, Mail and iTunes, I'm showing 5.93 GB used of that 10 Gig, so on a 4Gb machine swapping would have already taken place.
 
OP
S
Joined
Aug 22, 2013
Messages
12
Reaction score
0
Points
1
Location
Spain
Your Mac's Specs
MBP (2009) 2.66GHz Core 2 duo; MacPro 2x2.8 Quad-core; iPad3 (retina)
Thanks for the answers, i'm planning to cram it full now, though 8GB is the max. Still, it feels as though it is not solving the major issue, as a slowdown and increased swap i had noticed before. What spooks me out is the sudden dramatic increase, and moreover, the fact swap is not freed back ( i.e. swapped :) ) not even for running no program at all!

Is it a good idea to replace all memory while this problem persists without knowing cause or correlation?
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
Swap space is not freed until a restart because it's always used.
Try this, if you don't use it already (and you should), download and use Onyx (the version for your particular OS).
Do the Automation section and clean up the drive. Note: this will also check the drive for problems, among other things.
Restart. Then see how your drive does. This will also help with any slowdowns.
 
OP
S
Joined
Aug 22, 2013
Messages
12
Reaction score
0
Points
1
Location
Spain
Your Mac's Specs
MBP (2009) 2.66GHz Core 2 duo; MacPro 2x2.8 Quad-core; iPad3 (retina)
)download and use Onyx

I'll do that tomorrow first thing, running Onyx via on another machine first (and this disc in target). With it running as ridiculously slow slow as it does now (which, i stress, happened suddenly, not slowly) and the storage being 'eaten' all until choke within say 20 minutes without running anything, i don't trust the program to finish running on the disc itself.

Apart from doing that, can memory hardware just be exchanged without any other (low-level) problem occurring on top? Just to be sure i'm not taking it too mechanistically..
 
Joined
Feb 14, 2004
Messages
4,781
Reaction score
166
Points
63
Location
Groves, Texas
I would also suggest you get a copy of Disk Warrior. It can repair things others cant.
I've never heard of running Onyx in target mode but if it works...
Worst comes to worst, make a good backup and reinstall the system, assuming there's nothing wrong with the drive itself.

Adding memory can do nothing but good. Unless of course you get the wrong memory. Go here: Other World Computing (OWC) - Performance Upgrades For Your Mac
 
OP
S
Joined
Aug 22, 2013
Messages
12
Reaction score
0
Points
1
Location
Spain
Your Mac's Specs
MBP (2009) 2.66GHz Core 2 duo; MacPro 2x2.8 Quad-core; iPad3 (retina)
Well you were right about running Onyx in target mode, it can't be (it can't check s.m.a.r.t. status over firewire even). Just on the startup disc it's been opened upon.

Unfortunately, i was right too about suspecting adding RAM would not solve the problem. I've crammed it full (8GB max) and before described slowness & swap problem remains. It only seems to refresh the screen itself slightly faster, although opening and dragging a finder window around is still very jumpy, not fluid at all, a nd increasingly so as the storage gets filled with bogus swap again. (Could the graphic card/gpu have any influence? The mouse itself does move fluidly, over a near-stuck desktop.)

I'm trying to run Onyx on the disc itself now, but it's like pumping your tyres full while they have a dime's width hole in 'em and then try cycling home a mile throug loose sand :/ Meaning: i had to break it off by pushing the button (hard shut down), it took too long even to open the program...

I'm considering the $100 for disc warrior, as the memory already cost me the same (OWC couldn't deliver this fast, i'm in europe). Any other options for diagnostic / repair? Would running a diagnostic through Mavericks on a USB be a possibility? A colleage proposed that.
 
M

MacInWin

Guest
Let Onyx finish. Killing it by hard shutdown in the middle may have only made the problem worse, not better. The opening of the program is the step Onyx uses to test the internal boot hard drive, so let it run and be patient. If you have a lot of problems, or if the drive is full, that process can take a while. From all the descriptions you've given, your drive is pretty well screwed up and Onyx will take a while to sort it.
 
OP
S
Joined
Aug 22, 2013
Messages
12
Reaction score
0
Points
1
Location
Spain
Your Mac's Specs
MBP (2009) 2.66GHz Core 2 duo; MacPro 2x2.8 Quad-core; iPad3 (retina)
Thanks for clarifying MacInWin. I should have mentioned though that Onyx did not even open yet - instead, for some strange reason (?) ages after having double-clicked the dmg i had downloaded and copied over using the disc in target mode, not Onyx or its installer did open, but Disc Utilities. By then HD storage had dropped 10GB from written bogus swap and things became too slow to do anything, or trust something was being done.

With the disc running this slow, you still recommend letting Onyx 'finish', even if it would run stuck halfway?
 
Joined
Sep 30, 2007
Messages
9,962
Reaction score
1,235
Points
113
Location
The Republic of Neptune
Your Mac's Specs
2019 iMac 27"; 2020 M1 MacBook Air; macOS up-to-date... always.
M

MacInWin

Guest
OK, that was weird. From that description, you haven't installed Onyx yet, you just have the .dmg file with the installer on it. I don't remember if Onyx has an installer or if it just needed to be copied to the Applications folder, but you can go ahead and install it, then run it and let it run. Something is eating your main memory, which is triggering swap, which is filling up your hard drive and slowing things down.

But before we get to that, can you run Activity Monitor (In the Programs/Ulitities folder)? Look at the Memory tab, click on the column header Memory to sort so that the biggest is up at the top and let us know what you see (a screen shot would be best, but just look for what's the biggest memory user(s) at the top of that display). Maybe we can kill the offending application and stop the consumption of memory that is forcing swap.
 
M

MacInWin

Guest
I'm most inclined to agree with all the prior advice given, but all this disk activity makes me wonder if the drive is failing. The SMART test that Onyx runs is a basic reporting tool relying on what the drive manufacturer's guidelines are, and they tend to hold off reporting failure until things are critical. See my guide linked below for how to do more thorough testing.
http://www.mac-forums.com/forums/os-x-operating-system/301467-ntfs-mac-not-working.html#post1528773
But a failing HD won't trigger swap. It may slow down swap if the swap hits a bunch of bad sectors and gets fragmented, but if AM measures swap happening, then memory is being consumed by something. What we need to do is get the memory leak stopped so RAM is not stressed, swap stops and then we can see how the drive is doing.
 
Joined
Sep 30, 2007
Messages
9,962
Reaction score
1,235
Points
113
Location
The Republic of Neptune
Your Mac's Specs
2019 iMac 27"; 2020 M1 MacBook Air; macOS up-to-date... always.
But a failing HD won't trigger swap. It may slow down swap if the swap hits a bunch of bad sectors and gets fragmented, but if AM measures swap happening, then memory is being consumed by something. What we need to do is get the memory leak stopped so RAM is not stressed, swap stops and then we can see how the drive is doing.

Agreed. I was more thinking it should be investigated after getting things under control but that wasnt clear.

Back to the OP.... Do you have any software that runs persistently in the background, like AV software or system monitoring tools?
 
OP
S
Joined
Aug 22, 2013
Messages
12
Reaction score
0
Points
1
Location
Spain
Your Mac's Specs
MBP (2009) 2.66GHz Core 2 duo; MacPro 2x2.8 Quad-core; iPad3 (retina)
What we need to do is get the memory leak stopped so RAM is not stressed, swap stops and then we can see how the drive is doing.

Yes, that sounds like what I meant with asking earlier how to stop/limit swap.

Do you have any software that runs persistently in the background, like AV software or system monitoring tools?

Well, I'm now running only in safe mode (normal mode just got c.o.m.p.l.e.t.e.l.y. stuck) so the answer should be 'no'.

But just before all of this started to get truly dramatic, I installed an update to Bjango's iStat Menu, which I usually run continuously to monitor the system. I remember that after that, it did not reload itself properly (it puts a set of meters in the menu bar above, quite handy; now it didn't) which by then I ignored for a sec, too busy with something else. Now I suspect perhaps that program did not 'close' itself when the computer eventually went to sleep (the sleep that it never woke properly from).

So, I plugged the laptop as a target disc again, and deleted that program and the folders I found in the library (in application support in this case). After deleting all the trash, I'm now starting it up once more in safe mode to see if it makes any difference. Fingers crossed.
 
Joined
Sep 30, 2007
Messages
9,962
Reaction score
1,235
Points
113
Location
The Republic of Neptune
Your Mac's Specs
2019 iMac 27"; 2020 M1 MacBook Air; macOS up-to-date... always.
FWIW, I use iStat Menus also and it doesn't cause problems for me. I only use a small subset of its features though (temps in menubar).
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top