Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

10.9 - disabling memory compression

531 views
Skip to first unread message

Alan Browne

unread,
Apr 13, 2014, 12:07:36 PM4/13/14
to

As most of you know, Mavericks has a nifty, fast and efficient memory
compression scheme to more efficiently employ allocated but more or less
dormant memory. This really makes sense in Macs with 8 GB or less
memory and is especially a boon to laptops as it, in the end, saves
battery power (less swapping), (along with other features such as timer
coalescing).

On my 24 GB iMac, I checked the status of the memory lately and despite
running, at the time 4 OS' concurrently (OS X, Ubunutu, OpenSUSE and
WinXP) the compressed memory at the time was a mere 2.1 MB - that is
less than 1/100 of a percent of the installed memory while having about
10 GB of free memory.

While the compression scheme is reputed to be very efficient (CPU wise)
it seems needless on systems with a large amount of installed memory and
esp. desktops that don't have an especial need to save the odd joule
here and there.

Of course there are helpful people out there so I found these helpful
commands:

AlansMac:~ alanbrowne$ sysctl -a vm.compressor_mode
vm.compressor_mode: 4
AlansMac:~ alanbrowne$

Compressor mode: 4 is "on".

To set it to 1 (off):

sudo nvram boot-args="vm_compressor=1"

So I'm now running in that mode.

--
"Big data can reduce anything to a single number,
but you shouldn’t be fooled by the appearance of exactitude."
-Gary Marcus and Ernest Davis, NYT, 2014.04.07

bi...@mix.com

unread,
Apr 13, 2014, 1:57:57 PM4/13/14
to
Alan Browne <alan....@freelunchvideotron.ca> writes:

> Compressor mode: 4 is "on".
>
> To set it to 1 (off):
>
> sudo nvram boot-args="vm_compressor=1"
>
> So I'm now running in that mode.

How much memory are you using with it off?

Billy Y..
--
sub #'9+1 ,r0 ; convert ascii byte
add #9.+1 ,r0 ; to an integer
bcc 20$ ; not a number

Warren Oates

unread,
Apr 13, 2014, 2:50:49 PM4/13/14
to
In article <hrWdnZbK8t3VK9fO...@giganews.com>,
Hmm. There's a bunch of people (including my other half) complaining of
getting "your computer is running out of application memory" errors that
no one (certainly not anyone from Apple) knows how to fix. The basic
Apple Duhfense League response seems to be "repair the the permissions."
Yeah, right. Would this compressed memory thingie have ought to do with
this? I haven't had the problem on the MacBook Pro with 4 gigs RAM, but
the fancy new iMac (with 8 gigs) does it from time to time.
--
Where's the Vangelis music?
Pris' tongue is sticking out in in the wide shot after Batty has kissed her.
They have put back more tits into the Zhora dressing room scene.
-- notes for Blade Runner

Paul Sture

unread,
Apr 13, 2014, 3:18:25 PM4/13/14
to
I've been wondering about this in conjunction with the VMs I'm running.
If I don't do anything in a running VM for several hours it's hard to
get its full attention back. For example I can be playing music in a
Linux VM for hours on end but when I switch focus to it and try to do
something on the command line it takes ages for that bit to spring into
life. I didn't see this before Mavericks so wondered if the bits of
the VM not being currently used have been compressed and the delay is
in bringing them back.

Dunno, just a theory, and maybe it's addressed in VMware Fusion 6, but since
VMware refuse to tell me what improvements that actually brings apart from
"it's better", the money is staying in my wallet thanks.

P.S. I also noticed that if you go into Finder, highlight an app and
hit cmd-I the resulting Info window displays an item called "Prevent App
Nap". I did try checking this on the Fusion app but didn't see any
difference, so cleared it again. Does anyone know more about this feature?

--
Paul Sture

The final step of #heartbleed recovery is to call your mother, and advise
her to change her maiden name -- @gojomo

Alan Browne

unread,
Apr 13, 2014, 3:35:29 PM4/13/14
to
On 2014.04.13, 13:57 , bi...@MIX.COM wrote:
> Alan Browne <alan....@freelunchvideotron.ca> writes:
>
>> Compressor mode: 4 is "on".
>>
>> To set it to 1 (off):
>>
>> sudo nvram boot-args="vm_compressor=1"
>>
>> So I'm now running in that mode.
>
> How much memory are you using with it off?

There's no discernible difference. The point is not what is saved
memory wise (on a system with so much memory) but that it's yet another
process that executes for no advantage whatsoever.

Alan Browne

unread,
Apr 13, 2014, 3:37:45 PM4/13/14
to
No idea - my instinct would be that with 8 GB (or certainly 4 GB) or
less, to leave the compression on.

OTOH, turning it off (and back on again replacing the "1" with a "4") is
trivial enough to try out (requires restarting of course).

Warren Oates

unread,
Apr 13, 2014, 3:51:45 PM4/13/14
to
In article <srydnWyjLYQUetfO...@giganews.com>,
I've set it to "off" (and rebooted). See what happens.

Alan Browne

unread,
Apr 13, 2014, 3:55:55 PM4/13/14
to
Today I've had 3 OS' running in Fusion (v 5.x) and left alone for quite
a while - all 3 are immediately responsive on return (regardless of the
mem compression flag. Again I have a lot of memory on this iMac.

> Dunno, just a theory, and maybe it's addressed in VMware Fusion 6, but since
> VMware refuse to tell me what improvements that actually brings apart from
> "it's better", the money is staying in my wallet thanks.

:-)

> P.S. I also noticed that if you go into Finder, highlight an app and
> hit cmd-I the resulting Info window displays an item called "Prevent App
> Nap". I did try checking this on the Fusion app but didn't see any
> difference, so cleared it again. Does anyone know more about this feature?

Never noticed it before. Thanks. I'll play with it - but I doubt it
will improve things much on this Mac. I'd _want_ it running on my SO's MBA.

Leonard Blaisdell

unread,
Apr 13, 2014, 10:35:09 PM4/13/14
to
In article <534adc8b$0$18926$c3e8da3$cc4f...@news.astraweb.com>,
Warren Oates <warren...@gmail.com> wrote:

> Hmm. There's a bunch of people (including my other half) complaining of
> getting "your computer is running out of application memory" errors that
> no one (certainly not anyone from Apple) knows how to fix. The basic
> Apple Duhfense League response seems to be "repair the the permissions."
> Yeah, right. Would this compressed memory thingie have ought to do with
> this? I haven't had the problem on the MacBook Pro with 4 gigs RAM, but
> the fancy new iMac (with 8 gigs) does it from time to time.

Housekeeping? You can quit a PC app from a window. You need to quit an
app with the Mac from the menu or command-q. My wife, who uses a PC at
work and a Mac at home, instinctively closes a window with that red dot
and assumes that the app has quit. She's getting better.
Get a whole bunch of dormant apps and associated limbo files and memory
becomes an issue regardless of compression. Restart works well. Just a
thought.

leo

Your Name

unread,
Apr 14, 2014, 12:34:35 AM4/14/14
to
In article <130420141935099966%leobla...@sbcglobal.net>, Leonard
I don't know whether they work with Mavericks, but there are at least a
couple of add-ons that auto-quit applications when the last window is
closed.

- RedQuits
https://www.macupdate.com/app/mac/39814/redquits

- StopLight
http://lifehacker.com/202621/download-of-the-day-stoplight-mac

Of course, that is a nuisance when you want to clse the last window and
open another or create a new one.

Warren Oates

unread,
Apr 14, 2014, 7:51:59 AM4/14/14
to
That's not what's going on here. 'Tis true the oul 'Woman leaves more
stuff open than she should, but we've always had Macs and she's been
doing it since System 6 (which is the last time we regularly saw that
'out of memory' thing). This is something brand new that started with
Mavericks on the new iMac.

There's a big long thread about it here:

https://discussions.apple.com/thread/5474263?tstart=0

with the usual ADF stuff about "third-party" apps and "how big is your
hard drive" and just about anything to deny any problems exist ever on
the Blessed Platform. Some people blame Mail while an iMovie update
fixed the problem for others, but we don't use iMovie ever; some people
had problems with the Calendar cache, but we don't use that either
(BusyCal).

Alan Browne

unread,
Apr 14, 2014, 4:30:05 PM4/14/14
to
On 2014.04.13, 22:35 , Leonard Blaisdell wrote:

> Housekeeping? You can quit a PC app from a window. You need to quit an
> app with the Mac from the menu or command-q.

Not always so. There are a variety of apps that shut off on closing the
window (red button). The calculator and the App Store being a couple of
them. There are others.

The general approach is that an app is not running "in its window" but
that its windows are extensions to the app. But that doesn't apply in
all cases.

Further, app that run in a terminal window will be force quit if the
terminal window they are running in is closed.


My wife, who uses a PC at
> work and a Mac at home, instinctively closes a window with that red dot
> and assumes that the app has quit. She's getting better.
> Get a whole bunch of dormant apps and associated limbo files and memory
> becomes an issue regardless of compression. Restart works well. Just a
> thought.

CMD-Q or dock bar quitting doesn't require that much ... memory ... on
the part of the user. What doesn't help is that Lion (or ML) and later
blue dots on the dock are so much harder to see than in the prior dock.
Not sure what possesses Apple to do these things.

You can also CMD-Tab through the apps and when an app you want to shut
down is boxed, while continuing to hold down CMD, hit Q instead of tab
to quit the app (or W to simply close the window)...

Alan Browne

unread,
Apr 14, 2014, 4:30:36 PM4/14/14
to
On 2014.04.14, 00:34 , Your Name wrote:

> I don't know whether they work with Mavericks, but there are at least a
> couple of add-ons that auto-quit applications when the last window is
> closed.
>
> - RedQuits
> https://www.macupdate.com/app/mac/39814/redquits
>
> - StopLight
> http://lifehacker.com/202621/download-of-the-day-stoplight-mac
>
> Of course, that is a nuisance when you want to clse the last window and
> open another or create a new one.

Just remember CMD-Q. Not very hard at all.

JF Mezei

unread,
Apr 14, 2014, 5:36:24 PM4/14/14
to
On 14-04-14 16:30, Alan Browne wrote:

> Further, app that run in a terminal window will be force quit if the
> terminal window they are running in is closed.

Not sure if a character cell application is told to quit, or whether its
process is just unceremoniously euthanised when the parent process is
killed.


Alan Browne

unread,
Apr 14, 2014, 6:06:01 PM4/14/14
to
The later I think - since a terminal run program receives no signals
other than the keyboard or perhaps pipes. But if you bg the program and
make sure it has somewhere to dump its output, then it will keep running.

$ ./aprogram > ~/datadump/x.file &
$ exit

then close the window.

Rick Jones

unread,
Apr 14, 2014, 7:32:24 PM4/14/14
to
Alan Browne <alan....@freelunchvideotron.ca> wrote:
> Of course there are helpful people out there so I found these
> helpful commands:

> AlansMac:~ alanbrowne$ sysctl -a vm.compressor_mode
> vm.compressor_mode: 4
> AlansMac:~ alanbrowne$

> Compressor mode: 4 is "on".

> To set it to 1 (off):

> sudo nvram boot-args="vm_compressor=1"

> So I'm now running in that mode.

If 1 is off and 4 is on, what are 0, 2 and 3?

rick jones
--
The computing industry isn't as much a game of "Follow The Leader" as
it is one of "Ring Around the Rosy" or perhaps "Duck Duck Goose."
- Rick Jones
these opinions are mine, all mine; HP might not want them anyway... :)
feel free to post, OR email to rick.jones2 in hp.com but NOT BOTH...

Alan Browne

unread,
Apr 14, 2014, 7:58:48 PM4/14/14
to
On 2014.04.14, 19:32 , Rick Jones wrote:
> Alan Browne <alan....@freelunchvideotron.ca> wrote:
>> Of course there are helpful people out there so I found these
>> helpful commands:
>
>> AlansMac:~ alanbrowne$ sysctl -a vm.compressor_mode
>> vm.compressor_mode: 4
>> AlansMac:~ alanbrowne$
>
>> Compressor mode: 4 is "on".
>
>> To set it to 1 (off):
>
>> sudo nvram boot-args="vm_compressor=1"
>
>> So I'm now running in that mode.
>
> If 1 is off and 4 is on, what are 0, 2 and 3?

Not sure if "3" is defined since "DEFAULT" or'd with "NO_SWAP" might end
in tears...


http://opensource.apple.com/source/xnu/xnu-2422.1.72/osfmk/vm/vm_pageout.h

Near the bottom of that.


#define VM_PAGER_DEFAULT 0x1 /* Use default pager. */
#define VM_PAGER_COMPRESSOR_NO_SWAP 0x2 /* In-core compressor
only. */
#define VM_PAGER_COMPRESSOR_WITH_SWAP 0x4 /* In-core
compressor + swap backend. */
#define VM_PAGER_FREEZER_DEFAULT 0x8 /* Freezer backed by
default pager.*/
#define VM_PAGER_FREEZER_COMPRESSOR_NO_SWAP 0x10 /* Freezer
backed by in-core compressor only i.e. frozen data remain in-core
compressed.*/
#define VM_PAGER_FREEZER_COMPRESSOR_WITH_SWAP 0x20 /* Freezer
backed by in-core compressor with swap support too.*/

Jolly Roger

unread,
Apr 14, 2014, 10:10:40 PM4/14/14
to
On 2014-04-14, Leonard Blaisdell <leobla...@sbcglobal.net> wrote:
> In article <534adc8b$0$18926$c3e8da3$cc4f...@news.astraweb.com>,
> Warren Oates <warren...@gmail.com> wrote:
>
>> Hmm. There's a bunch of people (including my other half) complaining of
>> getting "your computer is running out of application memory" errors that
>> no one (certainly not anyone from Apple) knows how to fix. The basic
>> Apple Duhfense League response seems to be "repair the the permissions."
>> Yeah, right. Would this compressed memory thingie have ought to do with
>> this? I haven't had the problem on the MacBook Pro with 4 gigs RAM, but
>> the fancy new iMac (with 8 gigs) does it from time to time.
>
> Housekeeping? You can quit a PC app from a window. You need to quit an
> app with the Mac from the menu or command-q. My wife, who uses a PC at
> work and a Mac at home, instinctively closes a window with that red dot
> and assumes that the app has quit. She's getting better.

It may come as a surprise to some that different doesn't automatically
mean inferior.

> Get a whole bunch of dormant apps and associated limbo files and memory
> becomes an issue regardless of compression. Restart works well. Just a
> thought.

And just because some random person says memory becomes an issue doesn't
automatically make it true.

--
E-mail sent to this address may be devoured by my ravenous SPAM filter.
I often ignore posts from Google. Use a real news client instead.

JR

Király

unread,
Apr 15, 2014, 2:01:42 AM4/15/14
to
Alan Browne <alan....@freelunchvideotron.ca> wrote:
> Not always so. There are a variety of apps that shut off on closing the
> window (red button). The calculator and the App Store being a couple of
> them. There are others.

The general guideline is that an edit-a-document app (TextEdit, Preview,
Pages, basically apps that do nothing without an open document) will
stay open afer all of its windows (i.e. documents) are closed. An app
that isn't document based (Disk Utility, Contacts, Dictionary) will quit
when its (usually single and does everything) window is closed.

--
K.

Lang may your lum reek.

Kevin McMurtrie

unread,
Apr 15, 2014, 3:38:28 AM4/15/14
to
In article <hrWdnZbK8t3VK9fO...@giganews.com>,
Alan Browne <alan....@FreelunchVideotron.ca> wrote:

It shouldn't make any difference if you have lots of RAM. What does
'top' say?

I've found that compression happens after memory mapped files and caches
start getting aggressively purged. When a large database is running,
compression kicks in after the disk is already thrashing badly on file
I/O.
Message has been deleted
Message has been deleted

Alan Browne

unread,
Apr 16, 2014, 4:54:50 PM4/16/14
to
Which makes sense to you and me but is confusing at first to Windows
users coming to Mac. I got over it in about my first day with a Mac -
others may take longer.

Alan Browne

unread,
Apr 16, 2014, 5:04:58 PM4/16/14
to
On 2014.04.16, 09:32 , Lewis wrote:
> In message <hrWdnZbK8t3VK9fO...@giganews.com>
> Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>> AlansMac:~ alanbrowne$ sysctl -a vm.compressor_mode
>> vm.compressor_mode: 4
>> AlansMac:~ alanbrowne$
>
>> Compressor mode: 4 is "on".
>
>> To set it to 1 (off):
>
>> sudo nvram boot-args="vm_compressor=1"
>
>> So I'm now running in that mode.
>
> Don't do this. It's stupid, there's absolutely no reason for it, it will
> probably (if not likely) fuck something up down the line and then you'll
> be complaining about how your computer is acting weird or something and
> you'll think it's OS X's fault instead of your own dumb fault (or Alan's
> by proxy).

1. I've done it.
2. It is not stupid - I have much more memory than the laptops this is
designed to help.
3. It is unlikely to affect anything down the road - and if it does, it
is easily remedied.
4. As usual you shade things with ad hominem's. Grow up.
Message has been deleted

Alan Browne

unread,
Apr 16, 2014, 4:58:29 PM4/16/14
to
It does. With mem compression on, there is a tiny sliver of
compression (described above). It's probably a tiny sliver of CPU as
well - but there's really no point in having it at all on my computer so
I turned it off.

top reports 0 swaps on my machine at present ... even with 3 VM's
running under Fusion, + Photoshop + Bridge + the "usual" stuff.

> I've found that compression happens after memory mapped files and caches
> start getting aggressively purged. When a large database is running,
> compression kicks in after the disk is already thrashing badly on file
> I/O.

On my SO's laptop, mem compression is effective from right after boot (2
GB RAM with shared video memory).

Alan Browne

unread,
Apr 17, 2014, 3:15:17 PM4/17/14
to
On 2014.04.16, 20:04 , Lewis wrote:
> In message <ivGdnYspFZvkbdPO...@giganews.com>
> Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>> On 2014.04.16, 09:32 , Lewis wrote:
>>> In message <hrWdnZbK8t3VK9fO...@giganews.com>
>>> Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>>>> AlansMac:~ alanbrowne$ sysctl -a vm.compressor_mode
>>>> vm.compressor_mode: 4
>>>> AlansMac:~ alanbrowne$
>>>
>>>> Compressor mode: 4 is "on".
>>>
>>>> To set it to 1 (off):
>>>
>>>> sudo nvram boot-args="vm_compressor=1"
>>>
>>>> So I'm now running in that mode.
>>>
>>> Don't do this. It's stupid, there's absolutely no reason for it, it will
>>> probably (if not likely) fuck something up down the line and then you'll
>>> be complaining about how your computer is acting weird or something and
>>> you'll think it's OS X's fault instead of your own dumb fault (or Alan's
>>> by proxy).
>
>> 1. I've done it.
>
> I still say it's a stupid thing to do.

Without any firm reason to say so. Just because Apple added it (and
really, for laptops running on batteries - which is their largest
market), does not mean it is required. Were it bad then selecting the
mode as I did would have been disabled.

>> 2. It is not stupid - I have much more memory than the laptops this is
>> designed to help.
>
> It is stupid, you gain *nothing* and you much with the system in an way
> that is unintended.

It is not stupid at all and it is not 'unintended' since it is a mode
that can be set. That module has several modes, actually.

And yes, there is a gain by turning it off. Compression, even as cpu
efficient as the technique used, does use cpu cycles.

>> 3. It is unlikely to affect anything down the road - and if it does, it
>> is easily remedied.
>
> You have no idea what it might affect down the road, and you will
> probably have no idea that the thing it does affect is affected by this,
> and are also unlikely to even remember you did this. For no reason. For
> no benefit at all.

Why is it important to you that I do as you say rather than as I want?

Out of several people who have replied, you're the only one saying it's
a stupid thing (and for no founded reason).

And again I have my reasons (you present "fears") and there is a benefit
(even if it's not much).

>> 4. As usual you shade things with ad hominem's. Grow up.
>
> You need to look that up, there was no ad hominem in my post.

Really, please explain, above: QUOTE instead of your own dumb fault (or
Alan's by proxy). UNQUOTE

Every time you reply to someone saying they are doing something "stupid"
it is an attack on them. Then there is your childish "by proxy" jibe).

I don't mind reasoned debate, but every time you object to something you
tend to colour it with labels.

It's juvenile - at best.

android

unread,
Apr 17, 2014, 3:29:07 PM4/17/14
to
In article <lZednfcNMN_dtc3O...@giganews.com>,
Alan Browne <alan....@FreelunchVideotron.ca> wrote:

> >> 4. As usual you shade things with ad hominem's. Grow up.
> >
> > You need to look that up, there was no ad hominem in my post.
>
> Really, please explain, above: QUOTE instead of your own dumb fault (or
> Alan's by proxy). UNQUOTE

That would be one... ;-)
--
teleportation kills
http://tinyurl.com/androidphotography

android

unread,
Apr 17, 2014, 3:29:10 PM4/17/14
to
In article <lZednfcNMN_dtc3O...@giganews.com>,
Alan Browne <alan....@FreelunchVideotron.ca> wrote:

> And yes, there is a gain by turning it off. Compression, even as cpu
> efficient as the technique used, does use cpu cycles.

Have you noticed it? Do you know what kind of compression it is? Is it
merely defraging the ram or is it reusing file fragments?

JF Mezei

unread,
Apr 17, 2014, 3:30:56 PM4/17/14
to
On 14-04-17 15:15, Alan Browne wrote:

> Without any firm reason to say so. Just because Apple added it (and
> really, for laptops running on batteries - which is their largest
> market), does not mean it is required. Were it bad then selecting the
> mode as I did would have been disabled.


It is interesting when you compare it to sleep mode. For a laptop, the
sleep mode is different since by default it has the code to cause it to
eventually write memory contents to disk when battery is too low and
fully shutdown. By default, this is not enabled on desktops since it is
not deemed to have any value (since they don't generally run on batteries)

Apple could have done the same for the memory compression feature.


On the other hand, a desktop with multiple cores and insufficient RAM
might benefot from memory compression if it is performed by an otherwise
idle core, since it wil reduce paging/swapping to disk.

Alan Browne

unread,
Apr 17, 2014, 3:48:11 PM4/17/14
to
On 2014.04.17, 15:29 , android wrote:
> In article <lZednfcNMN_dtc3O...@giganews.com>,
> Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>
>> And yes, there is a gain by turning it off. Compression, even as cpu
>> efficient as the technique used, does use cpu cycles.
>
> Have you noticed it? Do you know what kind of compression it is? Is it
> merely defraging the ram or is it reusing file fragments?

Noticed it? Yes - there is no more compression indicated in the
memory monitor.

Noticed it? No - I can't say the computer is any faster - but
that is of course subjective.

Algorithm:
https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Oberhumer

android

unread,
Apr 17, 2014, 3:58:38 PM4/17/14
to
In article <HZKdndcOP49rss3O...@giganews.com>,
Alan Browne <alan....@FreelunchVideotron.ca> wrote:

> On 2014.04.17, 15:29 , android wrote:
> > In article <lZednfcNMN_dtc3O...@giganews.com>,
> > Alan Browne <alan....@FreelunchVideotron.ca> wrote:
> >
> >> And yes, there is a gain by turning it off. Compression, even as cpu
> >> efficient as the technique used, does use cpu cycles.
> >
> > Have you noticed it? Do you know what kind of compression it is? Is it
> > merely defraging the ram or is it reusing file fragments?

Your link suggest that it's the latter.
>
> Noticed it? Yes - there is no more compression indicated in the
> memory monitor.
>
> Noticed it? No - I can't say the computer is any faster - but
> that is of course subjective.
>
> Algorithm:
> https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Oberhumer
--
teleportation kills
http://tinyurl.com/androidphotography

Alan Browne

unread,
Apr 17, 2014, 4:02:02 PM4/17/14
to
On 2014.04.17, 15:30 , JF Mezei wrote:
> On 14-04-17 15:15, Alan Browne wrote:
>
>> Without any firm reason to say so. Just because Apple added it (and
>> really, for laptops running on batteries - which is their largest
>> market), does not mean it is required. Were it bad then selecting the
>> mode as I did would have been disabled.
>
>
> It is interesting when you compare it to sleep mode. For a laptop, the
> sleep mode is different since by default it has the code to cause it to
> eventually write memory contents to disk when battery is too low and
> fully shutdown. By default, this is not enabled on desktops since it is
> not deemed to have any value (since they don't generally run on batteries)
>
> Apple could have done the same for the memory compression feature.

Except for the memory size issue^.

If they considered it at all, perhaps they believed there was more
complexity in having options for a) "desktop" machines with lots of
memory, b) desktops with modest memory and c) laptops.

Simpler to give everyone the same flavour.

Would be nice to have it as a reboot option - of course that's more code
to write and test.

> On the other hand, a desktop with multiple cores and insufficient RAM
> might benefot from memory compression if it is performed by an otherwise
> idle core, since it wil reduce paging/swapping to disk.

^As I pointed out in the OP, it's probably not appropriate to disable at
or below 8 GB - not to mention laptops.

I have 24 GB - more than ample for my iMac and my needs. Originally I
was going to add 8 GB for a 16 GB total. Lewis pointed out that I would
be better off to add 16 for a total of 24 as a long term plan. Made
great sense for less than $100 more.

Should my memory needs grow, I have an additional 8 GB of room that I
can grow this iMac - that day may never come - OTOH, I'll likely be
using this iMac through about 2020 unless silliness occurs. (I could
have wrung another year or so out of the other iMac - but the resale
value was still quite high...).

My next iMac may run on a slate of ARM processors...

Alan Browne

unread,
Apr 17, 2014, 4:07:52 PM4/17/14
to
On 2014.04.17, 15:58 , android wrote:
> In article <HZKdndcOP49rss3O...@giganews.com>,
> Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>
>> On 2014.04.17, 15:29 , android wrote:
>>> In article <lZednfcNMN_dtc3O...@giganews.com>,
>>> Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>>>
>>>> And yes, there is a gain by turning it off. Compression, even as cpu
>>>> efficient as the technique used, does use cpu cycles.
>>>
>>> Have you noticed it? Do you know what kind of compression it is? Is it
>>> merely defraging the ram or is it reusing file fragments?
>
> Your link suggest that it's the latter.

No. It's both.

The first : yes, it's noticeable as the compressed memory is now
disabled and therefore in the monitor shows as zero compressed memory.

The second: no, it's not like in casual use one notices that the
overall machine "feels" faster. I suppose I could write a program that
allocates and writes to a lot of large memory blocks and deallocates
them repeatedly and measure how quickly it does that with comp on and
off - but I'd waste a lot of time doing that.

>>
>> Noticed it? Yes - there is no more compression indicated in the
>> memory monitor.
>>
>> Noticed it? No - I can't say the computer is any faster - but
>> that is of course subjective.
>>
>> Algorithm:
>> https://en.wikipedia.org/wiki/Lempel%E2%80%93Ziv%E2%80%93Oberhumer


--

android

unread,
Apr 17, 2014, 4:10:29 PM4/17/14
to
In article <IK2dnXxzA92prs3O...@giganews.com>,
Alan Browne <alan....@FreelunchVideotron.ca> wrote:

> I have 24 GB - more than ample for my iMac and my needs. Originally I
> was going to add 8 GB for a 16 GB total. Lewis pointed out that I would
> be better off to add 16 for a total of 24 as a long term plan. Made
> great sense for less than $100 more.
>
> Should my memory needs grow, I have an additional 8 GB of room that I
> can grow this iMac - that day may never come - OTOH, I'll likely be
> using this iMac through about 2020 unless silliness occurs. (I could
> have wrung another year or so out of the other iMac - but the resale
> value was still quite high...).

You can't have to much RAM... Max it out and make a RAM disk for your
scratchy needs... ;-)

Alan Browne

unread,
Apr 17, 2014, 4:33:19 PM4/17/14
to
I have a ram disk - allocates up to 10 GB. I use it for downloads so
container files can be zapped after the extraction is done to disk.

Downside (if any) is that it 'holds' that memory even if the files are
erased and trash emptied. So if I DL 2 GB, unpack the file and save it
to disk, then delete & empty the RAM disk, that 4 or 5 GB of memory
remains allocated to the RAM disk. If needed I can unmount/remount the
ramdisk but that's rare - I usually end up re-booting for some other
reason before that's needed.

Jolly Roger

unread,
Apr 17, 2014, 5:54:22 PM4/17/14
to
On 2014-04-17, Alan Browne <alan....@FreelunchVideotron.ca> wrote:
> On 2014.04.17, 16:10 , android wrote:
>> In article <IK2dnXxzA92prs3O...@giganews.com>,
>> Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>>
>>> I have 24 GB - more than ample for my iMac and my needs. Originally I
>>> was going to add 8 GB for a 16 GB total. Lewis pointed out that I would
>>> be better off to add 16 for a total of 24 as a long term plan. Made
>>> great sense for less than $100 more.
>>>
>>> Should my memory needs grow, I have an additional 8 GB of room that I
>>> can grow this iMac - that day may never come - OTOH, I'll likely be
>>> using this iMac through about 2020 unless silliness occurs. (I could
>>> have wrung another year or so out of the other iMac - but the resale
>>> value was still quite high...).
>>
>> You can't have to much RAM... Max it out and make a RAM disk for your
>> scratchy needs... ;-)
>
> I have a ram disk - allocates up to 10 GB. I use it for downloads so
> container files can be zapped after the extraction is done to disk.
>
> Downside (if any) is that it 'holds' that memory even if the files are
> erased and trash emptied. So if I DL 2 GB, unpack the file and save it
> to disk, then delete & empty the RAM disk, that 4 or 5 GB of memory
> remains allocated to the RAM disk. If needed I can unmount/remount the
> ramdisk but that's rare - I usually end up re-booting for some other
> reason before that's needed.

What do you use to create/destroy the RAM disk?

Alan Browne

unread,
Apr 17, 2014, 6:13:59 PM4/17/14
to
either an app called RamDisk (from "Un cadavre exquis"[1]) which
"protects" it - won't allow eject unless done via the app. But sometimes
it refuses to start correctly - (a couple times since Mavericks) - so
then I use a command line to set one up:

diskutil erasevolume HFS+ 'RamDisk' `hdiutil attach -nomount ram://20000000`

But that one can be ejected easily so you can lose the contents in a
jiffy if you're careless in the finder sidebar.

[1] Yes - that means what you think it means.

Jolly Roger

unread,
Apr 17, 2014, 7:59:54 PM4/17/14
to
Cool, thanks. I've created them in the past from the command line.
Message has been deleted
Message has been deleted

Alan Browne

unread,
Apr 18, 2014, 9:44:40 AM4/18/14
to
On 2014.04.18, 01:46 , Lewis wrote:
> In message <lZednfcNMN_dtc3O...@giganews.com>
> Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>> On 2014.04.16, 20:04 , Lewis wrote:
>>> In message <ivGdnYspFZvkbdPO...@giganews.com>
>>> Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>>>> On 2014.04.16, 09:32 , Lewis wrote:
>>>>> In message <hrWdnZbK8t3VK9fO...@giganews.com>
>>>>> Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>>>>>> AlansMac:~ alanbrowne$ sysctl -a vm.compressor_mode
>>>>>> vm.compressor_mode: 4
>>>>>> AlansMac:~ alanbrowne$
>>>>>
>>>>>> Compressor mode: 4 is "on".
>>>>>
>>>>>> To set it to 1 (off):
>>>>>
>>>>>> sudo nvram boot-args="vm_compressor=1"
>>>>>
>>>>>> So I'm now running in that mode.
>>>>>
>>>>> Don't do this. It's stupid, there's absolutely no reason for it, it will
>>>>> probably (if not likely) fuck something up down the line and then you'll
>>>>> be complaining about how your computer is acting weird or something and
>>>>> you'll think it's OS X's fault instead of your own dumb fault (or Alan's
>>>>> by proxy).
>>>
>>>> 1. I've done it.
>>>
>>> I still say it's a stupid thing to do.
>
>> Without any firm reason to say so.
>
> That's incorrect. I gave a perfectly good reason, it is changing the way
> the system expects to be configured. That is generally a bad idea, and
> sometimes a very bad idea.

That's not "reason". That's "opinion".


>> Just because Apple added it (and
>> really, for laptops running on batteries - which is their largest
>> market), does not mean it is required. Were it bad then selecting the
>> mode as I did would have been disabled.
>
> There are many modes you can select that are certainly bad when you
> start looking at sysctl and kernel settings.
>
>> And yes, there is a gain by turning it off. Compression, even as cpu
>> efficient as the technique used, does use cpu cycles.
>
> Actually, that is also incorrect. The compression, much like the
> encryption in FileVault 2, doesn’t even go through the CPU.

The memory compression is run by the CPU.

>
>>>> 3. It is unlikely to affect anything down the road - and if it does, it
>>>> is easily remedied.
>>>
>>> You have no idea what it might affect down the road, and you will
>>> probably have no idea that the thing it does affect is affected by this,
>>> and are also unlikely to even remember you did this. For no reason. For
>>> no benefit at all.
>
>> Why is it important to you that I do as you say rather than as I want?
>
> I don't care what YOU do, I care that you are recommending it to
> others.

Where did I recommend it?

>
>> Out of several people who have replied, you're the only one saying it's
>> a stupid thing (and for no founded reason).
>
>> And again I have my reasons (you present "fears") and there is a benefit
>> (even if it's not much).
>
>>>> 4. As usual you shade things with ad hominem's. Grow up.
>>>
>>> You need to look that up, there was no ad hominem in my post.
>
>> Really, please explain, above: QUOTE instead of your own dumb fault (or
>> Alan's by proxy). UNQUOTE
>
> Yes? And? Mentioning your name doesn't make it ad hominem. Saying the
> idea is stupid because you have purple spots and drink rotted pig's
> blood would be ad hominem.

Your ad hominem's come in the form of your own lack of reasoned
argument: you can't make your case on logic so you append "stupid" to
shade your opinion of others.

>
>> Every time you reply to someone saying they are doing something "stupid"
>> it is an attack on them. Then there is your childish "by proxy" jibe).
>
> You are an ignorant fool. Saying that something someone is doing is
> stupid is not ad hominem. Saying it is stupid BECAUSE they are doing it
> is. Saying nothing about the idea at all and simply saying that the
> person presenting the idea has bad breath and therefore should be
> ignored, that would also be ad hominem.
>
> Calling you an ignorant fool is also not ad hominen, it is simply a
> statement of fact. And since your foolish ignorance is not my reason for
> saying your idea is stupid, no ad hominem at all.
>
> I never said YOU were stupid anyway, I said what you are doing is
> stupid. I am not directing the argument AT THE MAN, I am directing it at
> the idea, the action, the behavior.
>
>> I don't mind reasoned debate,
>
> Yes you do. Changing system settings, especially low-level ones, is
> dangerous and foolish and yes, even stupid. You claim there is a

Dangerous? How? Will nuclear weapons be launched?

Foolish? How? Will it turn my computer into a vampire?

Stupid? How? It was a reasoned decision based on what I read in a few
places.


> benefit, but show no evidence of this. Unless you are using the iOS 6
> virtual machine in XCode, there is absolutely no benefit to changing
> this setting. None. There is very great risk. Maybe not now, maybe not
> tomorrow. But almost certainly at some point.
>
> You have repeatedly ignored this reasoned argument and instead dismissed
> it with hand-wavery.
>

You gave no reasoned argument - just opinion and insults. As usual.
The sign of the loser, desperate now to roar and intimidate.

I'd say you're a tragic case - but I don't care.

Done with you. When you don't agree with what someone does you come out
attacking like a cornered rat. Really strange.

This is a mac system group - this is a system issue. And no harm will
come of it to me or anyone.

Alan Browne

unread,
Apr 18, 2014, 10:00:25 AM4/18/14
to
On 2014.04.18, 01:55 , Lewis wrote:
> In message <braoc8...@mid.individual.net>
> android <he...@there.was> wrote:
>> In article <lZednfcNMN_dtc3O...@giganews.com>,
>> Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>
>>> And yes, there is a gain by turning it off. Compression, even as cpu
>>> efficient as the technique used, does use cpu cycles.
>
>> Have you noticed it?
>
> No, he hasn't.

Which I stated in my reply to him. It is subjectively not noticeable.


He's much like the audiodweeb, "See, now that I switched
> over to the $100/ft speaker wire, the sound is so much better!"
>
> *THAT* is ad hominem, btw.

Yes. And not unexpected from you. And a very poor analogy to boot.

Of course the difference is I'm not "adding" something for no
perceivable effect, I'm removing something that is not at all needed on
my system.

>> Do you know what kind of compression it is? Is it
>> merely defraging the ram or is it reusing file fragments?
>
> John Siracusa:
> Like the HFS+ compression feature introduced in Snow Leopard, compressed
> memory trades relatively abundant CPU cycles for decreased disk I/O. The


IOW: your assertion in the other post that it's not CPU based was wrong.
Message has been deleted

JF Mezei

unread,
Apr 18, 2014, 5:21:40 PM4/18/14
to
On 14-04-18 17:06, Lewis wrote:

> I am pretty sure it is run by the encryption chip, in point of fact. I
> can't find the documentation on it though. Regardless, it is run by
> cycles that would otherwise be idle. So, zero cost.


Compression is done by the CPU. There is no "encryption chip".

You are correct that for the average workload, not all cores are used,
so the compression and decompression can use an otherwise idle core.
However, this causes that core to "wake up" and use power.

However, when you app that is on core 1 need memory that is in a
compressed "blob", it must wait for core #2 to coomplete the
decompression and insert the now valid page back into the virtualy
memroy for that process.

Apple argued that with current CPUs this is now faster than waiting for
disk to read data.

What is not clear to me is whether the compression kicks in whenever
there is memory that is found to be idle, or whether it only kicks in
when the system realises it is short of RAM and needs to free some.

In the former case, system slowdown would be "seen" (even if not felt)
on a system with plenty of free memory, at which point it makes sense to
disable it. But in the later case, compression would not kick in as long
as memory is ample, so there would be no penalty.



Alan Browne

unread,
Apr 18, 2014, 5:24:01 PM4/18/14
to
On 2014.04.18, 17:06 , Lewis wrote:
> In message <jeidnWFQ9arUsczO...@giganews.com>
> I am pretty sure it is run by the encryption chip, in point of fact.

And you remain wrong. And it's odd that you assert that it is h/w here,
yet in your other post you point out (via quotation) that it is done by
the CPU. Not even self consistent in your wrongness. But then I didn't
expect better, so don't sweat it.

I
> can't find the documentation on it though. Regardless, it is run by
> cycles that would otherwise be idle. So, zero cost.

That's not esp. so. It does it whenever there is memory that is idle
and can be packed away to make room for other things - that is not
exclusive to the CPU having (or not) other things to do.

>
>> Your ad hominem's come in the form of your own lack of reasoned
>> argument: you can't make your case on logic so you append "stupid" to
>> shade your opinion of others.
>
> Your ignorance on the definition of ad hominem is quite spectacular.
> Calling an idea stupid is not an ad hominem attack.

The way you use it is - you write in a way that implies anyone trying
something you don't agree with as stupid.

>
> Anyway, I'm done with you. If you continue to post stupid hacks, I will
> continue to reply to them warning others not to try them, but this

Funny that nobody else has objected.

> thread has passed the point of anything useful. Feel free to fuck up
> your own computer however you want.

Nothing is fucked up. Works fine. And will for a long time, I'm sure.

>
> Don't you have a bit of a history of having weird behavior on your Macs?
> Strange problems no one else has?

Nothing others don't experience - I find others with the same/similar
issues - solutions are a different thing.

Recently the first Mavericks update 10.9.1 resulted in many odd things -
but then a lot of people reported similar and different odd things at
the same time.

Warren Oates

unread,
Apr 18, 2014, 5:25:42 PM4/18/14
to
In article <slrnll34tq....@amelia.local>,
Lewis <g.k...@gmail.com.dontsendmecopies> wrote:

>
> Anyway, I'm done with you. If you continue to post stupid hacks, I will
> continue to reply to them warning others not to try them, but this
> thread has passed the point of anything useful. Feel free to fuck up
> your own computer however you want

That's the stupidest thing I've read (well, you know, outside of the
stuff in AUK) in ages. It's not a "stupid hack," it's part of how the
system works. What you're saying is that we should accept our Holy
Blessed OS as it comes from The Blessed Factory and Make No Changes Ever
or else the Sanctified Rectum of Steve (SRS) might, I dunno, pucker, or
transmogrify or summat.

Don't log in as root. No don't. Not ever. Aw geez, aw geez, aw geez; ya
didn't did ya?

Warren "sudo su" Oates.

Alan Browne

unread,
Apr 18, 2014, 5:30:57 PM4/18/14
to
On 2014.04.18, 17:21 , JF Mezei wrote:
> What is not clear to me is whether the compression kicks in whenever
> there is memory that is found to be idle, or whether it only kicks in
> when the system realises it is short of RAM and needs to free some.

Since it compresses small amounts (10 -100 MB worth) on my system even
when there is over 10 GB available I assume it compresses on any
opportunity to do so and not solely because there is a pressing need.

Alan Browne

unread,
Apr 18, 2014, 5:59:56 PM4/18/14
to
Oops - the app RamDisk does not protect from eject - but it does
immediately remount the drive with the same name if you do eject it.

nospam

unread,
Apr 18, 2014, 6:49:46 PM4/18/14
to
In article <53519765$0$61394$c3e8da3$5e5e...@news.astraweb.com>, JF
Mezei <jfmezei...@vaxination.ca> wrote:

> Apple argued that with current CPUs this is now faster than waiting for
> disk to read data.

it has been for a while.

apple added compressed files several years ago and has now extended it
to memory.

20 years ago, connectix had a product called ramdoubler. it's not a new
concept.

it's faster to move a smaller chunk of compressed data and uncompress
it than it is to move a larger uncompressed chunk.
Message has been deleted

bi...@mix.com

unread,
Apr 19, 2014, 11:21:45 AM4/19/14
to
Lewis <g.k...@gmail.com.dontsendmecopies> writes:

> > Warren "sudo su" Oates.

This gives you the bash shell.

> sudo -s is better, I think.

This gives you whatever's in $SHELL.

I usually use 'sudo su -' as I want
a root login shell. Neither of the
above two do that.

Billy Y..
--
sub #'9+1 ,r0 ; convert ascii byte
add #9.+1 ,r0 ; to an integer
bcc 20$ ; not a number

bi...@mix.com

unread,
Apr 19, 2014, 12:06:16 PM4/19/14
to
Alan Browne <alan....@freelunchvideotron.ca> writes:

> it's noticeable as the compressed memory is now
> disabled and therefore in the monitor shows as
> zero compressed memory.

On a machine with typically 4409MB used and 3783MB
free, since this thread began I have yet to see any
compressed memory.

bi...@mix.com

unread,
Apr 19, 2014, 12:33:05 PM4/19/14
to
JF Mezei <jfmezei...@vaxination.ca> writes:

> Compression is done by the CPU. There is no "encryption chip".

I was wondering about that.

> You are correct that for the average workload, not all cores are used,
> so the compression and decompression can use an otherwise idle core.

Half of mine are asleep most of the time.

> However, this causes that core to "wake up" and use power.

bi...@mix.com

unread,
Apr 19, 2014, 12:37:42 PM4/19/14
to
Lewis <g.k...@gmail.com.dontsendmecopies> writes:

> Don't do this. It's stupid, there's absolutely no reason for it, it will
> probably (if not likely) fuck something up down the line and then you'll
> be complaining about how your computer is acting weird or something and
> you'll think it's OS X's fault instead of your own dumb fault (or Alan's
> by proxy).

The thing here is, the risk remains the same even just leaving everything
as Apple themselves have configured the system.

If, by the way, they were better, I'd be the very first to admit it.

Alan Browne

unread,
Apr 19, 2014, 12:37:56 PM4/19/14
to
On 2014.04.19, 12:06 , bi...@MIX.COM wrote:
> Alan Browne <alan....@freelunchvideotron.ca> writes:
>
>> it's noticeable as the compressed memory is now
>> disabled and therefore in the monitor shows as
>> zero compressed memory.
>
> On a machine with typically 4409MB used and 3783MB
> free, since this thread began I have yet to see any
> compressed memory.

On this machine (24 GB) there is compressed memory right out of the gate
on boot. Not much mind you (~100 MB). I suppose I could really load in
the apps and data and see if I could force the compression - maybe next
time I reboot.

I just looked on my SO's laptop (2 GB MBA) and she's at 1.98 GB used,
300 MB swap and 300 MP compressed...

I think I'll roll her back to Mountain Lion one of these days.

Jolly Roger

unread,
Apr 19, 2014, 1:27:00 PM4/19/14
to
On 2014-04-18, Alan Browne <alan....@FreelunchVideotron.ca> wrote:
> On 2014.04.17, 19:59 , Jolly Roger wrote:
>> On 2014-04-17, Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>
>>> either an app called RamDisk (from "Un cadavre exquis"[1]) which
>>> "protects" it - won't allow eject unless done via the app. But sometimes
>>> it refuses to start correctly - (a couple times since Mavericks) - so
>>> then I use a command line to set one up:
>>>
>>> diskutil erasevolume HFS+ 'RamDisk' `hdiutil attach -nomount ram://20000000`
>>>
>>> But that one can be ejected easily so you can lose the contents in a
>>> jiffy if you're careless in the finder sidebar.
>>>
>>> [1] Yes - that means what you think it means.
>>
>> Cool, thanks. I've created them in the past from the command line.
>
> Oops - the app RamDisk does not protect from eject - but it does
> immediately remount the drive with the same name if you do eject it.

Good to know. Thanks.
Message has been deleted

Warren Oates

unread,
Apr 19, 2014, 4:01:35 PM4/19/14
to
In article <liu4a8$kp1$1...@reader2.panix.com>, bi...@MIX.COM wrote:

> I usually use 'sudo su -' as I want
> a root login shell. Neither of the
> above two do that.

That's the one I meant though. I was too busy being cute.
--
Where's the Vangelis music?
Pris' tongue is sticking out in in the wide shot after Batty has kissed her.
They have put back more tits into the Zhora dressing room scene.
-- notes for Blade Runner

Martin Frost me at invalid stanford daht edu

unread,
Apr 19, 2014, 5:15:42 PM4/19/14
to
Alan Browne <alan....@FreelunchVideotron.ca> writes:

> On 2014.04.17, 19:59 , Jolly Roger wrote:
> > On 2014-04-17, Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>
> >> either an app called RamDisk (from "Un cadavre exquis"[1]) which
> >> "protects" it - won't allow eject unless done via the app. But
> >> sometimes it refuses to start correctly - (a couple times since
> >> Mavericks) - so then I use a command line to set one up:
> >>
> >> diskutil erasevolume HFS+ 'RamDisk' `hdiutil attach -nomount ram://200> 00000`
> >>
> >> But that one can be ejected easily so you can lose the contents
> >> in a jiffy if you're careless in the finder sidebar.
> >>
> >> [1] Yes - that means what you think it means.
> >
> > Cool, thanks. I've created them in the past from the command line.
>
> Oops - the app RamDisk does not protect from eject - but it does
> immediately remount the drive with the same name if you do eject it.

With or without the data that was on the RAM disk before the eject???

Martin

Alan Browne

unread,
Apr 19, 2014, 6:06:42 PM4/19/14
to
Blown away.

If I get a RoundTUIT I'll write a program to sniff in memory to look for
files after such an eject.

Martin Frost me at invalid stanford daht edu

unread,
Apr 19, 2014, 8:16:45 PM4/19/14
to
Alan Browne <alan....@FreelunchVideotron.ca> writes:

> On 2014.04.19, 17:15 , Martin Frost me at invalid stanford daht edu wrote=
> :
> > Alan Browne <alan....@FreelunchVideotron.ca> writes:
> >
> >> On 2014.04.17, 19:59 , Jolly Roger wrote:
> >>> On 2014-04-17, Alan Browne <alan....@FreelunchVideotron.ca> wrote:=
>
> >>
> >>>> either an app called RamDisk (from "Un cadavre exquis"[1]) which
> >>>> "protects" it - won't allow eject unless done via the app. But
> >>>> sometimes it refuses to start correctly - (a couple times since
> >>>> Mavericks) - so then I use a command line to set one up:
> >>>>
> >>>> diskutil erasevolume HFS+ 'RamDisk' `hdiutil attach -nomount ram://2=
> 00> 00000`
> >>>>
> >>>> But that one can be ejected easily so you can lose the contents
> >>>> in a jiffy if you're careless in the finder sidebar.
> >>>>
> >>>> [1] Yes - that means what you think it means.
> >>>
> >>> Cool, thanks. I've created them in the past from the command line.
> >>
> >> Oops - the app RamDisk does not protect from eject - but it does
> >> immediately remount the drive with the same name if you do eject it.
> >
> > With or without the data that was on the RAM disk before the eject???
>
> Blown away.

OK, that's what I would have expected. Your comment about immediately
remounting it hinted that maybe that could save the data.

So RamDisk makes an accidental ejecting look like a mysterious
erasure. Not a whole lot of benefit in that.

Martin

Alan Browne

unread,
Apr 19, 2014, 8:32:24 PM4/19/14
to
The benefit of a ramdisk is as described earlier. I have accidentally
ejected the volume but well after I disposed of the data of interest as
needed (deleted or copied to other media).

I've yet (excuse me, need some wood to knock on) to lose data because of
an premature ejection. If that day should come, then the worst of the
damage will be to DL the file(s) again.

JF Mezei

unread,
Apr 19, 2014, 9:40:15 PM4/19/14
to
On 14-04-19 20:32, Alan Browne wrote:

> I've yet (excuse me, need some wood to knock on) to lose data because of
> an premature ejection. If that day should come, then the worst of the
> damage will be ...


Your wife making fun of your premature ejection problem :-)

Your Name

unread,
Apr 19, 2014, 11:45:53 PM4/19/14
to
In article <myeh0sx...@Sunburn.Stanford.EDU>, Martin Frost me at
Might be quicker than deleting lots of files from it, but that's about
the only potential benefit I can see.

As for RAM disks ... geez, talk about ressurecting the past. I remember
using those way back on the original Mac and Mac Plus (partly to save
continual swapping of floppy disks). Probably still have the software
for it on a floppy disk in the pile here :-)

Paul Sture

unread,
Apr 20, 2014, 2:33:42 AM4/20/14
to
On 2014-04-19, bi...@MIX.COM <bi...@MIX.COM> wrote:
> Alan Browne <alan....@freelunchvideotron.ca> writes:
>
>> it's noticeable as the compressed memory is now
>> disabled and therefore in the monitor shows as
>> zero compressed memory.
>
> On a machine with typically 4409MB used and 3783MB
> free, since this thread began I have yet to see any
> compressed memory.

16 GB RAM here, uptime 18.5 days. compressed memory currently sitting
at 3.49 GB.

It's running OS X Server with services I haven't used since boot, such as
Wiki and Web servers. There's also VMware Fusion with a couple of Linux
VMs, but I have stuff currently running in those at the moment.

I did try closing all apps except for Terminal a day or two ago and
compressed memory went down to 2.35 GB or so. Swap currently used is
1.21 GB.

It would be interesting to have a means of seeing what is where because as
I mentioned previously my VMs when left alone for long enough take some
of prodding to give me adequate response times: the fastest way I have
found so far is to suspend and resume the VMs or reboot them. I might be
falling foul of energy saving options in the client VM systems here.

P.S. I am currently chucking around files of up to 2 GB (some of those
being edited in Amadeus Pro) so my file buffers are getting exercised.

--
Paul Sture

The final step of #heartbleed recovery is to call your mother, and advise
her to change her maiden name -- @gojomo

Paul Sture

unread,
Apr 20, 2014, 2:53:40 AM4/20/14
to
On 2014-04-18, JF Mezei <jfmezei...@vaxination.ca> wrote:
> On 14-04-18 17:06, Lewis wrote:
>
>> I am pretty sure it is run by the encryption chip, in point of fact. I
>> can't find the documentation on it though. Regardless, it is run by
>> cycles that would otherwise be idle. So, zero cost.
>
>
> Compression is done by the CPU. There is no "encryption chip".
>
> You are correct that for the average workload, not all cores are used,
> so the compression and decompression can use an otherwise idle core.
> However, this causes that core to "wake up" and use power.

I am running VMware Fusion and am wondering how it deals with multiple
cores. Does it try to utilise these "intelligently" by spreading the load
across cores, for example?

> However, when you app that is on core 1 need memory that is in a
> compressed "blob", it must wait for core #2 to coomplete the
> decompression and insert the now valid page back into the virtualy
> memroy for that process.
>
> Apple argued that with current CPUs this is now faster than waiting for
> disk to read data.

Hmm. My Mac mini is the 2011 model, which isn't strictly speaking a
"current CPU". I'm probably being way too picky there.

> What is not clear to me is whether the compression kicks in whenever
> there is memory that is found to be idle, or whether it only kicks in
> when the system realises it is short of RAM and needs to free some.
>
> In the former case, system slowdown would be "seen" (even if not felt)
> on a system with plenty of free memory, at which point it makes sense to
> disable it. But in the later case, compression would not kick in as long
> as memory is ample, so there would be no penalty.

Given the way that Apple have steadily improved OS X memory management
over the years, they are probably paying close attention to this area and
I would not be surprised to see further improvements.

Paul Sture

unread,
Apr 20, 2014, 3:11:20 AM4/20/14
to
On 2014-04-14, Alan Browne <alan....@FreelunchVideotron.ca> wrote:
> On 2014.04.13, 22:35 , Leonard Blaisdell wrote:
>
>> Housekeeping? You can quit a PC app from a window. You need to quit an
>> app with the Mac from the menu or command-q.
>
> Not always so. There are a variety of apps that shut off on closing the
> window (red button). The calculator and the App Store being a couple of
> them. There are others.

This behaviour is programmable. In a Cocoa app the following code in
AppDelegate.m does the trick:

-(BOOL) applicationShouldTerminateAfterLastWindowClosed:
(NSApplication *) sender {
return YES;
}


> The general approach is that an app is not running "in its window" but
> that its windows are extensions to the app. But that doesn't apply in
> all cases.
>
> Further, app that run in a terminal window will be force quit if the
> terminal window they are running in is closed.

I have Terminal.app set to warn me and ask for confirmation if I try to
close it while something is running in a window. I typically run half a
dozen or so Terminal windows and the confirmation is presented on a per
window basis - windows not running anything get zapped, those running
something ask for confirmation in turn.

Paul Sture

unread,
Apr 20, 2014, 3:15:19 AM4/20/14
to
On 2014-04-14, JF Mezei <jfmezei...@vaxination.ca> wrote:
> On 14-04-14 16:30, Alan Browne wrote:
>
>> Further, app that run in a terminal window will be force quit if the
>> terminal window they are running in is closed.
>
> Not sure if a character cell application is told to quit, or whether its
> process is just unceremoniously euthanised when the parent process is
> killed.

Terminal Preferences -> Basic -> Shell

Prompt before closing:
* Always
* Never
* Only if there are processes other than the login shell and:

and below that you can specify additional processes to be checked against.

Paul Sture

unread,
Apr 20, 2014, 3:45:17 AM4/20/14
to
On 2014-04-14, Rick Jones <rick....@hp.com> wrote:
> Alan Browne <alan....@freelunchvideotron.ca> wrote:
>> Of course there are helpful people out there so I found these
>> helpful commands:
>
>> AlansMac:~ alanbrowne$ sysctl -a vm.compressor_mode
>> vm.compressor_mode: 4
>> AlansMac:~ alanbrowne$
>
>> Compressor mode: 4 is "on".
>
>> To set it to 1 (off):
>
>> sudo nvram boot-args="vm_compressor=1"
>
>> So I'm now running in that mode.
>
> If 1 is off and 4 is on, what are 0, 2 and 3?

Good question. I am used to these sort of things being a bit pattern
so 3 would be a combination of 1 and 2.

One quick search led me to this unanswered question on Stack Exchange,
complete with links to various source files.*

<http://apple.stackexchange.com/questions/118839/vm-compressor-mode-vm-compressor-mode-values-for-enabled-compressed-memory-in>

(I'll admit it's too early on a sunny Sunday morning for me to start
wading through the code)

* Given the copyright date of 2013 I see in vm_compressor.c, this may or
may not be the source used in 10.9.2

Paul Sture

unread,
Apr 20, 2014, 4:42:35 AM4/20/14
to
On 2014-04-18, Lewis <g.k...@gmail.com.dontsendmecopies> wrote:
> In message <jeidnWFQ9arUsczO...@giganews.com>
> Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>
>> The memory compression is run by the CPU.
>
> I am pretty sure it is run by the encryption chip, in point of fact. I
> can't find the documentation on it though. Regardless, it is run by
> cycles that would otherwise be idle. So, zero cost.

The only evidence I can find suggests it uses "spare cpu cycles". E.g.

<http://appleinsider.com/articles/13/06/12/compressed-memory-in-os-x-109-mavericks-aims-to-free-ram-extend-battery-life>

---------------------------------------------------------------------------
Apple states that its compression techniques "reduces the size of items
in memory that haven’t been used recently by more than 50 percent," and
states that "Compressed Memory is incredibly fast, compressing or
decompressing a page of memory in just a few millionths of a second."

Compressed Memory can also take advantage of parallel execution on
multiple cores "unlike traditional virtual memory," therefore "achieving
lightning-fast performance for both reclaiming unused memory and accessing
seldom-used objects in memory."
---------------------------------------------------------------------------

>
> Anyway, I'm done with you. If you continue to post stupid hacks, I will
> continue to reply to them warning others not to try them, but this
> thread has passed the point of anything useful. Feel free to fuck up
> your own computer however you want.

No, this is how folks learn how to get the last inch of performance out of
their kit. If nobody experimented it would be a sad world.

30+ years ago I was doing this sort of thing all the time for benchmarking
(hah!) purposes. It's how you learn which tweaks bring gain and which
bring pain. Yes, you are normally working in unsupported territory so you
have to be aware of that. And keep backups of course.

Copious backups and tested recovery procedures too.

And did I mention backups and *tested* recovery procedures? :-)

Paul Sture

unread,
Apr 20, 2014, 4:47:29 AM4/20/14
to
On 2014-04-18, Warren Oates <warren...@gmail.com> wrote:
>
> Don't log in as root. No don't. Not ever. Aw geez, aw geez, aw geez; ya
> didn't did ya?
>
> Warren "sudo su" Oates.

:-)

I do log in as root on Linux boxes and it really isn't a problem _for me_
because I've been working with fully privileged command line stuff for more
than 35 years.

Paul Sture

unread,
Apr 20, 2014, 4:53:41 AM4/20/14
to
On 2014-04-14, Alan Browne <alan....@FreelunchVideotron.ca> wrote:
> On 2014.04.14, 00:34 , Your Name wrote:
>
>> I don't know whether they work with Mavericks, but there are at least a
>> couple of add-ons that auto-quit applications when the last window is
>> closed.
>>
>> - RedQuits
>> https://www.macupdate.com/app/mac/39814/redquits
>>
>> - StopLight
>> http://lifehacker.com/202621/download-of-the-day-stoplight-mac
>>
>> Of course, that is a nuisance when you want to clse the last window and
>> open another or create a new one.
>
> Just remember CMD-Q. Not very hard at all.

But occasionally too easy to hit when I'm aiming for Cmd-W :-(

Alan Browne

unread,
Apr 20, 2014, 9:13:49 AM4/20/14
to
On 2014.04.20, 02:33 , Paul Sture wrote:
> On 2014-04-19, bi...@MIX.COM <bi...@MIX.COM> wrote:
>> Alan Browne <alan....@freelunchvideotron.ca> writes:
>>
>>> it's noticeable as the compressed memory is now
>>> disabled and therefore in the monitor shows as
>>> zero compressed memory.
>>
>> On a machine with typically 4409MB used and 3783MB
>> free, since this thread began I have yet to see any
>> compressed memory.
>
> 16 GB RAM here, uptime 18.5 days. compressed memory currently sitting
> at 3.49 GB.
>
> It's running OS X Server with services I haven't used since boot, such as
> Wiki and Web servers. There's also VMware Fusion with a couple of Linux
> VMs, but I have stuff currently running in those at the moment.
>
> I did try closing all apps except for Terminal a day or two ago and
> compressed memory went down to 2.35 GB or so. Swap currently used is
> 1.21 GB.
>
> It would be interesting to have a means of seeing what is where because as
> I mentioned previously my VMs when left alone for long enough take some
> of prodding to give me adequate response times: the fastest way I have
> found so far is to suspend and resume the VMs or reboot them. I might be
> falling foul of energy saving options in the client VM systems here.

Did you try turning off timer coalescing to see if your VM's would be
more responsive?

sudo sysctl -w kern.timer.coalescing_enabled=0

And/or AppNap for the VM's?

In Finder, applications, "Get Info" on the VM (Fusion or
whatever), and turn off AppNap in the GetInfo dialog.

Alan Browne

unread,
Apr 20, 2014, 9:22:58 AM4/20/14
to
On 2014.04.20, 02:53 , Paul Sture wrote:
> On 2014-04-18, JF Mezei <jfmezei...@vaxination.ca> wrote:
>> On 14-04-18 17:06, Lewis wrote:
>>
>>> I am pretty sure it is run by the encryption chip, in point of fact. I
>>> can't find the documentation on it though. Regardless, it is run by
>>> cycles that would otherwise be idle. So, zero cost.
>>
>>
>> Compression is done by the CPU. There is no "encryption chip".
>>
>> You are correct that for the average workload, not all cores are used,
>> so the compression and decompression can use an otherwise idle core.
>> However, this causes that core to "wake up" and use power.
>
> I am running VMware Fusion and am wondering how it deals with multiple
> cores. Does it try to utilise these "intelligently" by spreading the load
> across cores, for example?

In Fusion, in "Virtual Machine" settings, you set how many cores the VM
can use (when the VM is not running). From there I believe the OS (OS
X) and/or the processor spread the load automatically. Likewise assign
the memory the VM can use. AFAICT from the meters, assigning 4 cores to
a VM, the load is spread evenly-ish.

Alan Browne

unread,
Apr 20, 2014, 9:24:58 AM4/20/14
to
I wrote a program to keep my external disks up and spinning - if they
spin down, sometimes the system will want to spin one up on silly things
like changing a web page in a browser... so I also have terminal warn me
if I CMD-Q/W that process. I could BG it I suppose.

Alan Browne

unread,
Apr 20, 2014, 9:26:48 AM4/20/14
to
On 2014.04.20, 03:45 , Paul Sture wrote:
> On 2014-04-14, Rick Jones <rick....@hp.com> wrote:
>> Alan Browne <alan....@freelunchvideotron.ca> wrote:
>>> Of course there are helpful people out there so I found these
>>> helpful commands:
>>
>>> AlansMac:~ alanbrowne$ sysctl -a vm.compressor_mode
>>> vm.compressor_mode: 4
>>> AlansMac:~ alanbrowne$
>>
>>> Compressor mode: 4 is "on".
>>
>>> To set it to 1 (off):
>>
>>> sudo nvram boot-args="vm_compressor=1"
>>
>>> So I'm now running in that mode.
>>
>> If 1 is off and 4 is on, what are 0, 2 and 3?
>
> Good question. I am used to these sort of things being a bit pattern
> so 3 would be a combination of 1 and 2.
>
> One quick search led me to this unanswered question on Stack Exchange,
> complete with links to various source files.*
>
> <http://apple.stackexchange.com/questions/118839/vm-compressor-mode-vm-compressor-mode-values-for-enabled-compressed-memory-in>
>
> (I'll admit it's too early on a sunny Sunday morning for me to start
> wading through the code)
>
> * Given the copyright date of 2013 I see in vm_compressor.c, this may or
> may not be the source used in 10.9.2

I posted the header the other day for the correct source:

http://opensource.apple.com/source/xnu/xnu-2422.1.72/osfmk/vm/vm_pageout.h

The defs are near the end of the file.

Alan Browne

unread,
Apr 20, 2014, 9:27:44 AM4/20/14
to
On 2014.04.20, 04:53 , Paul Sture wrote:
> On 2014-04-14, Alan Browne <alan....@FreelunchVideotron.ca> wrote:
>> On 2014.04.14, 00:34 , Your Name wrote:
>>
>>> I don't know whether they work with Mavericks, but there are at least a
>>> couple of add-ons that auto-quit applications when the last window is
>>> closed.
>>>
>>> - RedQuits
>>> https://www.macupdate.com/app/mac/39814/redquits
>>>
>>> - StopLight
>>> http://lifehacker.com/202621/download-of-the-day-stoplight-mac
>>>
>>> Of course, that is a nuisance when you want to clse the last window and
>>> open another or create a new one.
>>
>> Just remember CMD-Q. Not very hard at all.
>
> But occasionally too easy to hit when I'm aiming for Cmd-W :-(

Yep
Message has been deleted
Message has been deleted

JF Mezei

unread,
Apr 21, 2014, 4:26:38 AM4/21/14
to
On 14-04-20 23:52, Lewis wrote:

> I still prefer the safety of running as a normal user account and using
> sudo to execute commands that need root privileges. It is safer.

I use X windows and Xterm. For system management, I have am Xterm logged
into root. For all other stuff, I have different Xterms logged into
unprivileged accounts.

The window title is set to indicate so.

(I very rarely use root on my desktop, but I have a X-serve root
displayed on my desktop (with Xterm it is easy to get the terminal
window to pop up on your desktop or laptop, assuming permissions are set
properly.

Warren Oates

unread,
Apr 21, 2014, 8:44:05 AM4/21/14
to
In article <slrnll95fq....@amelia.local>,
Lewis <g.k...@gmail.com.dontsendmecopies> wrote:

>
> And yeah, sure, sometimes I use sudo -s to invoke a root shell, but I
> try to avoid this and I also will set my terminal setting to a red
> background when I do.

I do that with Linux, where I use the root accounts more frequently.
Well, not a red background, but red text instead of the yellow that I
use normally. Also, the root prompt is different.
Message has been deleted

Warren Oates

unread,
Apr 22, 2014, 8:15:49 AM4/22/14
to
In article <slrnllbqoq....@amelia.local>,
Lewis <g.k...@gmail.com.dontsendmecopies> wrote:

> XTerm? Ugh. WHY?
>
> Terminal is so much nicer. And if not, then iTerm. XTerm sucked when it
> was cool.

Terminal isn't available in X. Anyway, for the Mac I use iTerm, which is
way better than Terminal.

In Linux I swap between Xterm and Sakura, based on my ever-shifting
moods. And something to do with the flakey way that Sakura handles
sending commands, I've forgotten why. Xterm is more work to set up, but
it's infinitely malleable.
0 new messages