DEVOPSLIB Telegram 40
🚨 Как быстро вычислить утечку памяти в Linux?

Когда система начинает “подтормаживать” без видимой причины — пора заподозрить утечку памяти. Вот как можно быстро найти виновника.

🔍 1. Проверяем использование памяти:

free -h

Если available стремится к нулю, есть повод копнуть глубже.

🔧 2. Сортируем процессы по потреблению RAM:

ps aux --sort=-%mem | head -n 10

Тут видно, кто больше всех ест память.

🧠 3. Следим за slab-объектами:

cat /proc/meminfo | grep Slab

Если значение растёт со временем — это сигнал утечки в ядре или драйверах.

🧪 4. Используем smem для точной оценки:

smem -r | sort -k 4 -nr | head

smem учитывает shared memory — оценка куда точнее, чем просто ps.

🎯 5. Если подозрение на конкретный процесс:
pmap — покажет, что именно грузит память:

pmap -x <PID>


🔥 Совет:
Запусти htop, нажми F6, выбери колонку RES, отсортируй. Увидишь — кто на самом деле обжора.

Подпишись 👉@devopslib
👍5



tgoop.com/devopslib/40
Create:
Last Update:

🚨 Как быстро вычислить утечку памяти в Linux?

Когда система начинает “подтормаживать” без видимой причины — пора заподозрить утечку памяти. Вот как можно быстро найти виновника.

🔍 1. Проверяем использование памяти:


free -h

Если available стремится к нулю, есть повод копнуть глубже.

🔧 2. Сортируем процессы по потреблению RAM:

ps aux --sort=-%mem | head -n 10

Тут видно, кто больше всех ест память.

🧠 3. Следим за slab-объектами:

cat /proc/meminfo | grep Slab

Если значение растёт со временем — это сигнал утечки в ядре или драйверах.

🧪 4. Используем smem для точной оценки:

smem -r | sort -k 4 -nr | head

smem учитывает shared memory — оценка куда точнее, чем просто ps.

🎯 5. Если подозрение на конкретный процесс:
pmap — покажет, что именно грузит память:

pmap -x <PID>


🔥 Совет:
Запусти htop, нажми F6, выбери колонку RES, отсортируй. Увидишь — кто на самом деле обжора.

Подпишись 👉@devopslib

BY Библиотека девопса | DevOps, SRE, Sysadmin


Share with your friend now:
tgoop.com/devopslib/40

View MORE
Open in Telegram


Telegram News

Date: |

On Tuesday, some local media outlets included Sing Tao Daily cited sources as saying the Hong Kong government was considering restricting access to Telegram. Privacy Commissioner for Personal Data Ada Chung told to the Legislative Council on Monday that government officials, police and lawmakers remain the targets of “doxxing” despite a privacy law amendment last year that criminalised the malicious disclosure of personal information. Private channels are only accessible to subscribers and don’t appear in public searches. To join a private channel, you need to receive a link from the owner (administrator). A private channel is an excellent solution for companies and teams. You can also use this type of channel to write down personal notes, reflections, etc. By the way, you can make your private channel public at any moment. Commenting about the court's concerns about the spread of false information related to the elections, Minister Fachin noted Brazil is "facing circumstances that could put Brazil's democracy at risk." During the meeting, the information technology secretary at the TSE, Julio Valente, put forward a list of requests the court believes will disinformation. 4How to customize a Telegram channel? Add the logo from your device. Adjust the visible area of your image. Congratulations! Now your Telegram channel has a face Click “Save”.!
from us


Telegram Библиотека девопса | DevOps, SRE, Sysadmin
FROM American