- Mac OS X: что такое sleepimage?
- [1] Как содержать свой Mac в чистоте
- Все действия вы проводите только на свой страх и риск!
- Отключаем режим гибернации (SafeSleep)
- Удаляем голосовые записи
- Избавляемся от временных файлов
- Чистим кеш «быстрого просмотра»
- sleepimage – the Mac OS X sleepimage file explained
- What is sleepimage in Mac OS X?
- Why is sleepimage taking up so much space? 2GB, 4GB, 8GB, etc?
- Can I safely delete sleepimage from my Mac?
- Where is sleepimage located?
- How to disable OS X from creating «sleep image?»
- Yukon Jack
- RV-ABZ
- jbarley
- RV-ABZ
- jbarley
- myxomatosis
- hallux
- jbarley
- Upgrader
- hallux
- Upgrader
- hallux
- Upgrader
- khoan
- Upgrader
- supergaia
- udance4ever
- Question: Q: How to disable sleep image creation
Mac OS X: что такое sleepimage?
Если вы когда-либо пользовались инструментом DaisyDisk для анализа использования места на жестком диске, вы, должно быть, замечали достаточно большой файл под названием sleepimage…
Sleepimage – это то, что хранится в памяти вашего Mac, когда он находится в спящем режиме, это – образ предыдущего состояния памяти Mac. Когда компьютер выходит из спящего режима, содержимое sleepimage считывается снова и вставляется обратно в активную память, таким образом, возвращая ваш Mac в прежнее состояние.
Почему sleepimage занимает так много места? 2Гб, 4Гб, 8Гб… ?
Файл sleepimage практически такого же размера, как и физический объем оперативной памяти на вашем компьютере. То есть, если у вас 2Гб RAM, то и sleepimage будет 2Гб. Вы можете узнать размер файла через Терминал:
ls -lh /private/var/vm/sleepimage
Потом вы увидите данные типа:
-rw——T 1 root wheel 4.0G Oct 7 15:46 /private/var/vm/sleepimage
Между ‘wheel’ и датой указан размер файла. В нашем случае это 4Гб. Если размер файла значительно превышает объем оперативной памяти, это может означать, что файл поврежден.
Можно ли безопасно удалить sleepimage?
Да. Вы можете удалить файл и он автоматически создастся следующий раз, когда ваш Mac перейдет в спящий режим. Удалить sleepimage можно с помощью команды в Терминале:
sudo rm /private/var/vm/sleepimage
Вам придется ввести пароль администратора для удаления файла.
Где находится sleepimage?
Как можно было догадаться по командам выше, sleepimage находится в директории:
Теперь вы знаете все секреты о загадочном большом файле на жестком диске вашего Mac.
Источник
[1] Как содержать свой Mac в чистоте
Обладатели Mac с жесткими дисками на несколько терабайт вряд ли когда-нибудь сталкивались с нехваткой свободного места на компьютере. Однако данный вопрос очень актуален для новых ноутбуков от Apple, которые оснащены твердотельными накопителями, причем их вместительность может не превышать 64 гигабайт — например, в 11-дюймовом MacBook Air. Как же облегчить его и без того тяжелую ношу?
Скажу сразу — способы, о которых я вам сегодня расскажу, смогут использовать только продвинутые пользователи OS X. Новичкам здесь делать и правда нечего: вся процедура завязана на приложении «Терминал», а одно неловкое движение может вызвать серьезные повреждения компьютера. Для тех, кто не хочет утруждать себя вводом длинных скучных команд, разработчики из MacPaw создали прекрасную программу CleanMyMac 2.
Если вы еще не испугались и готовы к довольно сложным операциям, должен напомнить вам самое главное правило.
Все действия вы проводите только на свой страх и риск!
А теперь, поехали.
Отключаем режим гибернации (SafeSleep)
Свободное место: 4 ГБ — 16 ГБ
Команда отключает встроенный в OS X режим гибернации, известный как SafeSleep. Он используется для сохранения содержимого оперативной памяти на устройство хранения данных, которое не зависит от потребления энергии. Специальный файл (sleepimage) появляется на жестком диске каждый раз, когда Mac переходит в режим сна, или когда у него садится батарея. Размер этого файла точно такой же, как емкость оперативной памяти вашего компьютера.
Открываем терминал и вводим команду
sudo pmset -a hibernatemode 0
Заходим в /private/var/vm/
Удаляем существующий файл sleepimage
sudo rm sleepimage
Предотвращаем последующее создание этого файла
chmod 000 /private/var/vm/sleepimage
Учтите, что после этой операции ваш Mac больше не сможет переходить в режим сна с автоматическим сохранением всех открытых файлов, поэтому не забывайте про Auto-Save.
Если вам вдруг не понравилось работать в таком режиме, вот способ отмены всех манипуляций:
sudo pmset -a hibernatemode 3; sudo rm /private/var/vm/sleepimage
Удаляем голосовые записи
Свободное место: 500 МБ — 3 ГБ и более
Не пользуетесь встроенными в OS X голосовыми подсказками? Зачем же они будут занимать лишнее место на жестком диске?
Снова отправляемся в терминал и вводим команду
Удаляем папку с голосовыми записями
sudo rm -rf Voices/*
Избавляемся от временных файлов
Свободное место: 500 МБ — 5 ГБ
Кеш вашей системы должен автоматически очищаться после каждой перезагрузки, но, к сожалению, далеко не всегда это случается. А если компьютер будет находиться во включенном состоянии, например, в течение месяца, то вам точно придется чистить его самим. Для этих целей в «Терминале» предусмотрена команда, которую ни в коем случае нельзя использовать при запущенных приложениях.
cd /private/var/tmp/; rm -rf TM*
Чистим кеш «быстрого просмотра»
Свободное место: 100 МБ — 300 МБ
«Быстрый просмотр» в OS X также имеет привычку сохранять кеш, поэтому периодически следует удалять эти файлы.
sudo rm -rf /private/var/folders/
Всего за четыре действия мы почистили Mac от самых разных файлов, суммарный размер которых варьируется от 5 ГБ до 20, а то и 30 ГБ. Неплохо, не так ли?
Повторюсь, данные операции рекомендуется проводить только опытным пользователям OS X. Поэтому лишний раз подумайте, не легче ли приобрести специальную программу для чистки жесткого диска.
В следующей части мы рассмотрим еще несколько нетривиальных способов для увеличения свободного места на компьютере.
Источник
sleepimage – the Mac OS X sleepimage file explained
If you’ve used a tool like DaisyDisk to analyze your Mac’s disk space usage, you may have come across a file named ‘sleepimage’ that is rather large.
What is sleepimage in Mac OS X?
The ‘sleepimage’ file is just what it sounds like, it’s what your Mac had in it’s memory when the machine went to sleep, creating an image of your Mac’s previous memory state. When your Mac wakes from sleep, the content of sleepimage is read again and placed back into active memory, and your Mac is returned to the state that it was in prior to sleeping. Think of it like a swapfile of sorts, but for sleep and wake functionality only.
Why is sleepimage taking up so much space? 2GB, 4GB, 8GB, etc?
The sleepimage file is generally the exact same size as the amount of physical RAM your Mac has. If your Mac has 2GB of RAM, the sleepimage file will also be 2GB because there are 2GB of data that need to be stored when your Mac is put to sleep. You can check the size of your sleepimage file by typing the following command into the Terminal:
ls -lh /private/var/vm/sleepimage
You will then see data like:
-rw——T 1 root wheel 4.0G Oct 7 15:46 /private/var/vm/sleepimage
And the number between ‘wheel’ and the date is the sleepimage file size, in this case it is 4 GB.
There are cases where the sleepimage file is significantly larger than your physical RAM and this can be due to the file becoming corrupted.
Can I safely delete sleepimage from my Mac?
Yes, you can remove sleepimage and it will just be created again automatically the next time your Mac is put to sleep. To delete sleepimage, type the following command into the Terminal:
sudo rm /private/var/vm/sleepimage
You’ll be asked for the administrator password to gain access to remove the file, this is normal.
Where is sleepimage located?
If it wasn’t obvious from the previous commands, sleepimage is located alongside your Mac swapfiles at:
Hopefully that helps to explain sleepimage a bit and now you’ll understand what this mysteriously large file is on your Mac hard drive.
Источник
How to disable OS X from creating «sleep image?»
Yukon Jack
macrumors member
I have been led to understand that sleep images are pretty important on MacBooks due to power considerations. however, I have a Mac Mini and when I occasionally use WhatSize to perform garbage collection, I always find a sleep image in /private/var/vm that eats up storage.
I also understand that this image is supposed to be trashed when the Mac wakes up but in my case, it isn’t. Is there a way to either fix the OS so that the sleep image is trashed on awake or to permanently disable its creation?
late 2012 Mac Min running OS X 10.9
macrumors 65816
RV-ABZ
macrumors 6502
jbarley
Contributor
And unless things have improved, Mavericks will re-create it on the next startup.
A tip I found some time ago that works like a charm goes thusly.
—————————————-
Set sleep mode in shell:
sudo pmset -a hibernatemode 0
Remove the image:
sudo rm /private/var/vm/sleepimage
Create a blanked file:
sudo touch /private/var/vm/sleepimage
Make file immutable:
sudo chflags uchg /private/var/vm/sleepimage
——————————————
The above commands do the necessary housekeeping to remove any existing sleepImage file, and then create a zero-byte locked SleepImage file, one which the operating system will leave untouched.
RV-ABZ
macrumors 6502
Sorry, but I’ve never seen any new sleepimage file after setting hibernatemode to 0 (which means plain old sleep to RAM, without any backup to disk).
That is valid across all recent OS X versions I’ve encountered since Leopard.
jbarley
Contributor
myxomatosis
macrumors member
Right way to disable the «Sleep» image forever:
View the sleep image size
Type in the Terminal: ls -lh /private/var/vm/sleepimage
Disable sleep mode:
Type in the Terminal: sudo pmset -a hibernatemode 0
Remove the image:
Type in the Terminal: sudo rm /private/var/vm/sleepimage
Create a 0-byte file:
Type in the Terminal: sudo touch /private/var/vm/sleepimage
Make the file not writable:
Type in the Terminal: sudo chflags uchg /private/var/vm/sleepimage
Run these commands one by one and reboot. After reboot, re-run the first command to see the sleep image size. It should look like this (0B):
hallux
macrumors 68040
jbarley
Contributor
Upgrader
macrumors 6502
I’m on Yosemite. If I follow these steps in Terminal, does this mean that my computer will never go to sleep?
hallux
macrumors 68040
Your computer will sleep but it won’t go into «safesleep» mode. There’s actually another switch I found to disable SafeSleep without messing with the SleepImage file.
In Terminal type the following command
If you see an entry called «autopoweroff», it should be set to 0 to disable that feature. To set it to 0, type the following
Here’s a description of the pmset command. Tread lightly.
***The Autopoweroff entry MAY have been introduced in Yosemite, I don’t have a Mavericks Mac handy (it’s at work).
Upgrader
macrumors 6502
Your computer will sleep but it won’t go into «safesleep» mode. There’s actually another switch I found to disable SafeSleep without messing with the SleepImage file.
In Terminal type the following command
If you see an entry called «autopoweroff», it should be set to 0 to disable that feature. To set it to 0, type the following
Here’s a description of the pmset command. Tread lightly.
***The Autopoweroff entry MAY have been introduced in Yosemite, I don’t have a Mavericks Mac handy (it’s at work).
hallux
macrumors 68040
Upgrader
macrumors 6502
khoan
macrumors newbie
has anyone tried setting hibernate file to void? please report and share result.
Upgrader
macrumors 6502
supergaia
macrumors member
udance4ever
macrumors member
hey i don’t mean to bump a 3 year old thread esp in 10.9 forum.
And unless things have improved, Mavericks will re-create it on the next startup.
A tip I found some time ago that works like a charm goes thusly.
—————————————-
Set sleep mode in shell:
sudo pmset -a hibernatemode 0
Remove the image:
sudo rm /private/var/vm/sleepimage
Create a blanked file:
sudo touch /private/var/vm/sleepimage
Make file immutable:
sudo chflags uchg /private/var/vm/sleepimage
——————————————
The above commands do the necessary housekeeping to remove any existing sleepImage file, and then create a zero-byte locked SleepImage file, one which the operating system will leave untouched.
for the record, this worked great on 10.11.6 on an old 2007 MacBook 2,1 (survived a reboot so far)
Источник
Question: Q: How to disable sleep image creation
Every time after I boot/reboot my Mac there is a ‘sleepimage’ file in private/var/vm that I have to manually trash. I never sleep my Mac, it’s either on or off. This sleepimage file takes up 35GB of space and as I run my OS from an SSD this is space that I need. I did not have this issue on 10.8 but has been persistent on 10.9 even after a clean install. How can I disable the creation of this file permanently or fix OS X so that the file is only created when it should be (when I put the Mac to sleep)?
Mac Pro, OS X Mavericks (10.9), 12-Core 3.06, 64GB RAM, SSD & 14TB
Posted on Nov 21, 2013 4:21 PM
hibernatemode = 3 is appropriate for portable Macs, and will write sleepimage to disk so that a battery-powered Mac can remove power to RAM while it sleeps for power conservation. That is the reason for the sleepimage file creation. It’s not related to using a UPS, which you can configure to sleep or shut down the Mac at programmed limits of time or battery charge. There is no difference to the Mac — it will either sleep or shut down in the same exact manner, with or without a UPS.
If a desktop loses power the sleepimage file is not used to restore RAM upon a subsequent startup. Although the sleepimage file is being written to disk every time your Mac sleeps, it can convey no benefit, so hibernatemode should be set to zero.
I believe you can reset hibernatemode to its default value of zero by resetting the NVRAM.
- Shut down your Mac.
- Locate the following keys on the keyboard: Command (⌘), Option, P, and R. You will need to hold these keys down simultaneously in step 4.
- Turn on the computer.
- Press and hold the Command-Option-P-R keys before the gray screen appears.
- Hold the keys down until the computer restarts and you hear the startup sound for the second time.
- Release the keys.
If that does not reset it to zero use Terminal:
sudo pmset -a hibernatemode 0
There are also third party hacks and utilities to manipulate system sleep variables that may have caused it to change from the zero value that it should have been. I don’t recommend using such things.
Источник