paulpen

Q: Preview memory sqroo-up

Okay, let's see if this posts without the profanity (although the Apple music forums are full of the f-word...)

An hour or so ago (that's how long it took me to get these forums to work in OS 10.4.11) I opened a 13 MB PDF in Preview, did a search for a particular word.... and everything froze. Couldn't kill Preview, couldn't quit other apps, couldn't even switch to the Finder for a minute. Then i got the pop-up "Your startup drive is almost full".

Indeed the startup drive WAS full--getinfo showed ZERO MEGS AVAILABLE. That's seriously messed up. Can someone tell me what happened? And, who wrote an app (Preview) that would do something like that?? That's beyond sick.

Filling my startup drive (there was almost 1 GB free before that) included writing thousands of files, many of which were stored on a temporary 300 MB RAMdisk. Why..? BECAUSE I DIDN'T WANT TO EXPAND THOUSANDS OF LITTLE FILES ONTO A PHYSICAL HARD DRIVE!!  RAMdisk memory usage (in Activity Monitor) went from 302 MB to about 4 MB, and free space on my Startup drive went from 900 MB to 0 MB. That's ZERO. Hence Preview itself somehow used 600 MB.

At this point I *might* have answered my own question--Opening a smaller PDF in preview and searching for the letter "e" grabbed about 30 MB (5813 occurrences of "e"). Incredible, but it's conceivable that in a PDF 10 times that size, it could have grabbed 300 MB, or maybe 600..??  If that is the cause, i.e. the pathetic MacOS Preview app in which it starts searching as soon as you start typing, then problem solved. Type faster, or else copy/paste your search term (how sick is it to have to do that?). Because if you're a slow typer, or start typing at the wrong instant, it'll start searching for a single f**kin' letter, e.g. "e" instead of the word "elephant."

But Preview still shouldn't grab 600+ MB, and I'm not convinced that was the cause. Has anyone else had this problem (I would assume)?





PowerMac, Mac OS X (10.4.11), G4; G5; Dual-Core iMac.

Posted on Sep 23, 2016 11:56 PM

Close

Q: Preview memory sqroo-up

  • All replies
  • Helpful answers

  • by Kenichi Watanabe,

    Kenichi Watanabe Kenichi Watanabe Sep 24, 2016 12:30 AM in response to paulpen
    Level 8 (39,338 points)
    Mac OS X
    Sep 24, 2016 12:30 AM in response to paulpen

    Mac OS X, like all modern operating systems, has a virtual memory scheme that uses significant storage space on the startup disk.  The amount of storage space being used for this VM "swap file" varies, depending on what the system is doing.

     

    1GB of free space on your startup disk is WAY too low.  You should keep at least 10% free space (or more).  Also, as the free space available goes lower and lower, what's still available as free space becomes more and more fragmented.  This can severely affect performance, because the system is trying to write to its VM file spread (into tiny pieces) all over your hard drive's media.  It can even hasten failure of your hard drive.

     

    So, it's unlikely that Preview (the app) used up 600mb of disk space by opening a PDF file.  The overall OS was doing what it does, and allocated more space for virtual memory, as needed.  When you first start up the Mac, the amount used by virtual memory initially is small.  But it can grow to several GBs in size as you use your Mac for various tasks.  If your Mac has low physical RAM, even more disk space gets used by virtual memory.

     

    You need to free up a lot more space on your startup disk, to allow the OS to operate efficiently.  Get an external drive, to off-load seldom used files.

  • by K Shaffer,

    K Shaffer K Shaffer Sep 24, 2016 12:36 AM in response to paulpen
    Level 6 (14,441 points)
    Desktops
    Sep 24, 2016 12:36 AM in response to paulpen

    In which powerPC Mac build version is this Tiger 10.4.11 running?

    You should a G4 and a G5. Perhaps system corruption or a failing

    hard drive is behind an issue where uncharacteristic effects occur.

     

    That is a very odd issue; and hard to understand as well.

     

    Oh, about the TenFourFox web browser. It is a little slow in Tiger 10.4.11

    as I can attest; but it does work and is recognized here better than an

    old Safari from 11 years ago. I was online with my recently restored iBook

    G4 the other day in the same OS X and the latest TenFourFox for the CPU

    series that model (last iBook G4 in 2005) uses. Be sure if you are running

    a G5 PowerPC model that you get the correct version of TenFourFox.

     

    About this other issue, I'm not sure about the cause behind Preview bizarre

    behavior; except for possible system corruption or bad hard drive where it

    is creating errors in the files. If the hard drive is too full, that may cause issue.

     

    Sorry to not be of help in this mystery. If you have a backup or clone on external

    hard drive (drive enclosure would need FireWire connection + oxford-type chip

    in order to be able to boot or start from System clones - or the 'bootable' copies.

     

    Older versions of ShirtPocket's SuperDuper do well enough for older PPC; you

    may be able to find an old version of Bombich' Carbon Copy Cloner of vintage.

     

    Over-full hard drive capacity, lack of memory (RAM) & excessive read-writes to

    the hard drive as Virtual Memory usually relate to busy yet non-productive CPU

    and HDD usage. Plus heat is generated.

     

    Good luck in this matter!

  • by paulpen,

    paulpen paulpen Sep 24, 2016 1:36 AM in response to Kenichi Watanabe
    Level 1 (34 points)
    Apple Music
    Sep 24, 2016 1:36 AM in response to Kenichi Watanabe

    Thanks for the reply. I understand your point on fragmentation and free space, but OSX shouldn't be writing anything to my startup drive, ever. I have 1.5 GB RAM (the maximum for this machine) and only run "small" apps, e.g. MS Word 2004, Preview, Photoshop 7, and Safari. I regularly quit Safari when it accumulates too much RAM (monitored using Activity Monitor), e.g. >300 MB.

    

    It is indeed inconceivable that Preview would grab 600+ MB for anything, but your vague suggestion that OSX was simply "doing its thing" and swapping stuff to disk isn't comforting, or likely. What if I'd had 3 GB free on my startup disk--would Preview still have grabbed it all..?  It could be an error in Preview. Clearly that app is poorly written in that it starts searching as soon as you start typing. There's no conceivable reason for that. I mean, i want to search for the word "elephant", not the letter "e". It's absurd.

    Anyway, additional input would be appreciated if anyone has had this happen to them or can duplicate the problem.

  • by Kenichi Watanabe,

    Kenichi Watanabe Kenichi Watanabe Sep 24, 2016 2:06 AM in response to paulpen
    Level 8 (39,338 points)
    Mac OS X
    Sep 24, 2016 2:06 AM in response to paulpen

    but OSX shouldn't be writing anything to my startup drive, ever.

    Of course Mac OS X writes data to your startup disk.  In addition to the VM swap files, many temp log files and cache files are written to your startup disk, in the background.  Apps, like Safari, also write temporary cache files to the startup disk.  That's why it's essential to keep a sufficiently large amount of free space, so that the OS and apps can do background processing efficiently.

     

    1.5GB of RAM is sufficient for running Tiger, but virtual memory is still being used.  You need to restart the Mac to reset the amount of disk space being used for VM.  Space currently allocated to VM on your startup disk is not the same as RAM currently used.

    What if I'd had 3 GB free on my startup disk--would Preview still have grabbed it all..?

    I'm not saying Preview grabbed anything.  The problem you had probably had very little to do with Preview.  It could have happened while using Safari or reading your email.  Your system ran out of disk space to operate properly, period.  You just happened to be doing something in Preview when it happened.

     

    3GB is still too little.  Calculate 10% of total capacity (of your startup disk volume), and free up at least that much free space.  If the total capacity is low, like 100GB or less, you should free up more.  On my old iMac, I had a 160GB internal drive.  That's relatively small, so I (mostly) had only the OS and apps on the internal drive (with a small user folder).  Almost all of my user data was on an external FireWire drive, including things that took up a lot of space like my iTunes folder.  Plenty of free space on my internal drive.  Less stress on internal drive.  Mac OS X ran smoothly, no problems.

  • by K Shaffer,

    K Shaffer K Shaffer Sep 24, 2016 2:37 AM in response to paulpen
    Level 6 (14,441 points)
    Desktops
    Sep 24, 2016 2:37 AM in response to paulpen

    You can view Activity Monitor (utility) and click on the part where it shows

    CPU, & System Memory. Other points to inspect include disk activity, usage

    and finally, network.

     

    I've two older Macs here and am using one that originally shipped with Tiger

    OS X 10.4(.11) and now has Leopard 10.5.8; so I really see how the drive

    gets written to, and reads from (virtual memory temp swap files) constantly.

     

    Also, I'm using the latest TenFourFox version 45.4 (for G4 7450 G4e) in a

    G4 Mac Mini 1.5GHz with 1024MB RAM + 100GB HDD, OS X 10.5.8; w/ 66%

    unused HDD, uses up to 26GB Virtual Memory - read/write to hard drive.

     

    The actual memory (RAM) that is unused, now, with three browser windows

    open and activity monitor running, is about 85MB of 1024MB. This Mini can

    only use one- 1GB memory stick, tops. So it relies on VM. The rotational RPM

    of the HDD is a choke-point, so an SSD (solid state) drive would be a boon.

     

    So that is where the problem likely resides. And where information due to

    over-writing system content (if hard drive is overly full) gets corrupted.

     

    Anyway, the time here is going on 1:40AM locally; so it's offline & to sleep I go.

     

    Good luck & happy trails!

  • by paulpen,

    paulpen paulpen Sep 24, 2016 3:10 PM in response to Kenichi Watanabe
    Level 1 (34 points)
    Apple Music
    Sep 24, 2016 3:10 PM in response to Kenichi Watanabe

    You're right of course--apps and OSX are writing (and reading) files on the hdd regularly, e.g. cache files, log files, preferences, etc., and if you're running a large app (e.g. Tenfourfox), i think OSX only retrieves parts of it as needed, and the app may periodically load new fonts, etc.

    

    What I was really talking about is:  OSX shouldn't be using a swap file as VM when I've got plenty of RAM for OSX and every app that I'm running. As I said, they all have relatively small footprints. MS Word was using around 50 MB at the time, Safari less than 100 MB. I keep an eye on things w/ Activity Monitor just so this sort of thing doesn't happen.

    

    So this absolutely was an issue with Preview, even if OSX was also at fault. Everything was working fine all day, until i opened this big PDF and did a search. Before the crash, I had just done another search and Preview's memory usage jumped from maybe 30 MB to >80 MB. Then the fatal search, where I tried to type "elephant" and it searched for "e". In a 500 page PDF.

    It may not have been quite correct to say Preview grabbed all the RAM and VM. OSX grabbed it--for Preview. Or maybe OSX does use VM regularly because it's poorly designed. I'm sure MS Windows does.

    So the question then is:  is there a way to limit the amount of RAM (and VM) that a given app can have..? Not in a million years would I ever want Preview to take more than, say, 300 MB.

  • by Kenichi Watanabe,

    Kenichi Watanabe Kenichi Watanabe Sep 24, 2016 3:35 PM in response to paulpen
    Level 8 (39,338 points)
    Mac OS X
    Sep 24, 2016 3:35 PM in response to paulpen

    is there a way to limit the amount of RAM (and VM) that a given app can have..?

    Yes.  Use Mac OS 9.    I'm joking, of course, but Mac OS 9 (and earlier) did not have very good virtual memory management, and you had to manually assign how much RAM (as a range) for apps, if the default was not acceptable.  So you could actually do what you ask, but you don't actually want that "feature."  The VM in Mac OS X is much better, and allows Macs with limited RAM (like your old PowerPC Mac) to do more, without manual fiddling.

     

    Advice:  Keep plenty of free space on your startup disk volume, and don't worry about it...

  • by paulpen,

    paulpen paulpen Sep 26, 2016 8:46 PM in response to Kenichi Watanabe
    Level 1 (34 points)
    Apple Music
    Sep 26, 2016 8:46 PM in response to Kenichi Watanabe

    Yes, but what if I wanted to manually limit it..? Obviously, there are some very good reasons for limiting the RAM and the Virtual Memory a given application can grab.

    Witness this incident, in which Preview tried to use >900 MB. Maybe it only needed 700 MB (which I didn't have available in any event, even as VM), but what if I'd opened an even large PDF and it needed a couple of GIGAbytes..?

    That's the sort of absurd thing that should be preventable, e.g. by limiting the RAM a given application is allowed to have. I want to limit Preview to 330 MB. How do i do that?

  • by Kenichi Watanabe,

    Kenichi Watanabe Kenichi Watanabe Sep 26, 2016 9:06 PM in response to paulpen
    Level 8 (39,338 points)
    Mac OS X
    Sep 26, 2016 9:06 PM in response to paulpen

    Preview did not use ">900 MB."  Your startup disk simply ran out of required storage space for the overall OS to operate properly.  You just happen to be opening an PDF using Preview when it happened.  You don't know precisely how much free space was remaining immediately before you opened that PDF.

     

    You can't manually limit how much RAM an app uses (as the user).  Maybe the developer can limit how much RAM an app uses (in the code).  The whole point of a good multi-tasking OS is that you do NOT need to manually set RAM limits per app.  The OS allows apps to use available RAM (and VM) efficiently, based on what's happening overall.

     

    AND if you kept a reasonable amount of free space on your startup disk (not close to zero), you wouldn't be asking this question.

  • by paulpen,

    paulpen paulpen Sep 26, 2016 9:23 PM in response to Kenichi Watanabe
    Level 1 (34 points)
    Apple Music
    Sep 26, 2016 9:23 PM in response to Kenichi Watanabe

    I appreciate your replies, but I know how VM works. (and I'm continuing to post here because since Saturday, Apple has apparently revised their html/javascript again for this @#$% website, and now I can no longer start a new post--Hey Apple, why don't you test these forums on an actual PPC running 10.4 please..?):

    

    Anyway, if there's no way to limit the RAM an app can have, then I don't want the OS using a swap file. How about that? It sounds like instead of freeing up a couple of GB on my startup drive, I should fill it up so it only has, say, 100 MB free. Then this crap OS will only be able to write 100 MB of crap to it.

    The only reason it could have written 600+ MB to hdd the other day is because Preview f**ked up.

    Obviously I don't want apps to potentially be able to fill my hard drive, especially if I have way more than 600 MB free. I sure as h*ll don't even want the OS writing 600 MB to my hdd. Duh. 1.5 GB of actual RAM should be plenty for the small apps I normally use.

    

  • by Kenichi Watanabe,

    Kenichi Watanabe Kenichi Watanabe Sep 26, 2016 9:52 PM in response to paulpen
    Level 8 (39,338 points)
    Mac OS X
    Sep 26, 2016 9:52 PM in response to paulpen

    Based on what you are writing, it seems you do not understand how VM works...  If you don't let the OS do its thing with the VM swap files, you won't get very far with only 1.5GB of physical RAM.  Don't you want the ability to run and have open Mail, Safari, Word, Preview, etc. at the same time?  How would the OS inform you that you are running out of physical RAM, put up some annoying error message asking you to quit some apps?  Without VM, your Mac would run with the limitations and lack of responsiveness experienced when you start up from the optical drive (where system cannot use VM because the startup disk is read-only).

    It sounds like instead of freeing up a couple of GB on my startup drive, I should fill it up so it only has, say, 100 MB free.

    For any storage volume, whether it's your startup disk or on an external drive, you do NOT want to fill it up to nearly zero free space (like you do apparently).  When any volume is close to being full, the remaining free space gets fragmented into tiny pieces at an accelerated rate.  That can cause inefficient disk access for not only the OS, but for data access in general.  And it makes data corruption more likely, because files are highly fragmented on your hard drive, and errors are more likely.  When you have a sufficient amount of free space, data is written, erased, and re-written more efficiently with much less data fragmentation, because there is more contiguous free space available.

     

    Advice:  Keep plenty of free space on your startup disk volume, and don't worry about it...

  • by K Shaffer,

    K Shaffer K Shaffer Sep 26, 2016 10:30 PM in response to paulpen
    Level 6 (14,441 points)
    Desktops
    Sep 26, 2016 10:30 PM in response to paulpen

    Well, I've not found a problem with these ASC discussions with either Leopard 10.5.8 PPC G4

    or with Tiger 10.4.11 PPC G4 systems; in both cases using the latest TenFourFox browser.

     

    Also tested an older 'alleged to be supported' OmniWeb browser 5.11.2 that does OK; this

    is seen by gmail as an outdated Safari though. Errors/security issues in web mail can result.

     

    So you may have to choose to reinstall the Tiger 10.4 and the update the system, from scratch.

    That usually will fix a software issue; older bits or some unsupported third-party software.

    Helps to have at least 66% free unused drive capacity; as my iBook G4 mid-2005 does now.

    Nearly the same percentage as the Mini G4, though it has slightly larger drive capacity.

     

    Depending on what you attempt next & how you document the process, you could find

    resolution in troubleshooting; that may include a full re-install of carefully selected bits.

     

    Had you read through some older web site hints and tips on maintaining OS X? The ones I'd

    bookmarked appear to still be online although links back to old Apple support documents

    are no longer going anywhere helpful. The document URLs and information are both obsolete.

    With Tiger 10.4, some information from earlier OS X may be helpful; the old macattorney sites

    had several pages on how-to. To include religiously repairing permissions & other basic things.

     

    If your system is becoming corrupted, even after totally new installation on erased & reformatted

    hard disk drive, there is a fair chance the drive itself is becoming faulty; it could need replaced.

     

    The activity monitor and system profile, plus disk utility can be helpful. Also the boot install disc

    #1 with the disk utility version there can help. But only so much. An external clone on separate

    hard drive (in self-powered bootable FW400 enclosure; one with oxford-type chip or similar) is

    a great way to troubleshoot. You can keep a clean installation or a clone of first full reinstall on

    an external HDD, and that can be very helpful. A clone can be your Mac's best friend.

     

    Good luck & happy computing!

  • by K Shaffer,

    K Shaffer K Shaffer Sep 27, 2016 1:31 PM in response to paulpen
    Level 6 (14,441 points)
    Desktops
    Sep 27, 2016 1:31 PM in response to paulpen

    Some sources of additional (yet similar) information:

     

    • Mac OS X Basic Troubleshooting & Maintenance Tips - Tutorial, etc:

    http://www.gballard.net/macrant/osx_troubleshooting.html

     

    • The X Lab: The X-Lab FAQs:

    http://www.thexlab.com/faqs/faqs.html

     

    • OS X Maintenance & Troubleshooting - macattorney:

    http://www.macattorney.com/ts.html

     

    • Mac OS X 10.4 Tiger - Low End Mac:

    http://lowendmac.com/2005/mac-os-x-10-4-tiger/

     

    In some cases, if there is an issue with Tiger 10.4[.11]  & was

    an older installation where steps between the full installer w/

    subsequent step updates are patchworked, the last Combo

    Update can help. This is also the step to complete any 10.4

    installation from the install disc media. (Applications aside.)

     

    This download combo is still available, for PPC Macs, here:

    • Mac OS X 10.4.11 Combo Update (PPC)

     

    {Several other topics on setup for internet access, troubleshooting

    older AirPort base stations, & etc can be found online. Apple has

    a few older vintage articles that can be helpful for later setup use.

    If AirPort isn't happening, use of Ethernet is for default network.}

     

    So you can see there still are a few items available regarding

    topic sources for vintage & obsolete product/software online.

     

    A few good books, in the used market, include Missing Manuals

    by David Pogue. I've happened across a few, for pennies on $.

    Usually these are bought + gifted to Mac users with old models.

     

    There may be a Mac user group in your area, or perhaps a repair

    shop that has more than a passing interest in vintage/obsolete Mac

    so they may be helpful. + You can start friendships without buying.

     

    Without further adieu...

    Good luck & happy trails!