LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   memory logs (https://www.linuxquestions.org/questions/linux-newbie-8/memory-logs-4175597791/)

arun natarajan 01-19-2017 02:24 AM

memory logs
 
Hi,

I manually created a process to occupy the memory and when i tried to monitor the logs when physical memory is full, i was not able to see any "alert" or "warning" or "oom" or "out of memory" in logs.

Kindly let me know where can i check the logs when the physical memory is full ???

[root@localhost sa]# uname -a
Linux localhost.localdomain 3.10.0-123.el7.x86_64 #1 SMP Mon May 5 11:16:57 EDT 2014 x86_64 x86_64 x86_64 GNU/Linux

root@localhost /]# cat: write error: No space left on device
ls -ltr
total 17348580

[root@localhost /]# df -TH
Filesystem Type Size Used Avail Use% Mounted on
/dev/sda3 xfs 20G 20G 21k 100% /
devtmpfs devtmpfs 953M 0 953M 0% /dev
tmpfs tmpfs 958M 0 958M 0% /dev/shm
tmpfs tmpfs 958M 9.1M 949M 1% /run
tmpfs tmpfs 958M 0 958M 0% /sys/fs/cgroup
/dev/sda1 xfs 312M 89M 223M 29% /boot

no luck on using below commands...

[root@localhost /]# egrep -ir "alert|warning|oom|out of memory" /var/log/*
[root@localhost /]# journalctl -p warning

pan64 01-19-2017 02:36 AM

you can check, if the swap is in use the main memory usually is full. Otherwise you ought to read about memory handling on linux, it is not that simple at all. For example you can try to allocate more memory and even more memory (more than what you have).

arun natarajan 01-19-2017 03:55 AM

Hi,

I understand your point.

Here I am saying about permanent memory (hdd) and not about temporary memory(RAM, SWAP)

When my HDD is full , the logs should have the records of every transaction, right ?

pan64 01-19-2017 06:22 AM

when the root filesystem is full probably you cannot write log files...

JeremyBoden 01-19-2017 02:41 PM

Quote:

I manually created a process to occupy the memory...
Why?

Habitual 01-19-2017 04:29 PM

Show us your code and we'll show you ours? ;)

Jjanel 01-20-2017 03:23 AM

test_fill /boot partition, instead of root fs (where your /var/log is)
 
[wild-guess] Try `dmesg|tail`. Per `man dmesg`:
Quote:

dmesg is used to examine or control the kernel ring buffer.

The default action is to display all messages from the kernel ring buffer.
When fs is full, you cannot write to it, so you can't read the info that you canNOT write.
p.s. disk is NOT usually called "physical memory"; RAM is called memory; disk is called disk. See wiki. (Was your *goal* to study 'full' errors? Have /var/log on *separate* partition!)

Habitual 01-20-2017 06:17 AM

reboot.

Done.

clean out /home as it appears to be part of the 20 G / (sda5 ) partition.
Code:

sudo du -sh /home/*|sort -g
should show you something.

Code:

sudo du -sh /home/*/*| sort -g
should show you "more" of something.

Jjanel 01-20-2017 06:27 PM

Code:

/dev/sda3 xfs 20G  20G 21k 100% /
/dev/sda1 xfs 312M 89M 223M 29% /boot

@OP: change your `cat ... >file&` *TO* >/boot/file&
Pick a *test file name*. like zzz or MYfile, that doesNOT overwrite/damage anything already there!

Then, try your egrep and journalctl commands. Let us know if that helps.

p.s. your /home may be empty, if you didn't put anything there; mine (tempVBoxes) often is;
`reboot` may loose/erase/destroy your "kernel ring buffer", but I'm not sure.
(I think SunOS4.x used to save it across reboots, for logging, but I haven't taken the time to try/study this on Linux.)

Also, please Edit in Post#1 here the Title of this Thread to be more accurately descriptive, like:
Want to see/view system log error messages when a filesystem is full/filled (learning)

This will help others find this solution in the future, esp. via. "Similar Threads" at bottom of page. Also, use CODE tags. ('bbcode' formatting)

pan64 01-21-2017 03:49 AM

probably you can remove: /var/cache/apt/archives/*
although it is not a nice solution
by the way, what will du -sh /var/* respond?


All times are GMT -5. The time now is 12:50 AM.