memory

Where is 512M RAM from?

Where is 512M RAM from? In Virtual machine, Kali, I assigned the memory 4G, like this; But there is a problem. I installed self-build kernel at the guest to hack the memory. # uname -a Linux 15ud490-gx76k 6.8.4+ #8 SMP PREEMPT_DYNAMIC Sat Apt 6 15:49:20 KST 2024 x86_64 x86_64 x86_64 GNU/Linux And I want to …

Total answers: 2

What does the "segfault at X" kernel log message mean if X is very large?

What does the "segfault at X" kernel log message mean if X is very large? I’ve got a device with bad RAM. Running memtest overnight shows all faulting addresses to be in the 0x7d0000000 – 0x7f0000000 range. I plan to replace the RAM, but until then, I’ve disabled a 2GB chunk around it with memmap=: …

Total answers: 1

Linux ate my RAM

Linux ate my RAM I know this seems like a duplicate of many other posts in here, but I beg to differ. as this (to my not very experienced eyes) doesn’t seem to be a caching problem. We have a server with 256G of RAM, the usage of which is always 95% to 99% with …

Total answers: 1

What does Memory allocation mean?

What does Memory allocation mean? I use Linux Mint 21.2 and my machine is Intel Core i-7 6700 3.4GHZ. I wrote a prime test in Python, and I checked it with large numbers. It is like many tests, a variation of little Fermat, so I do some modular exponentiation like powmod(3, n-1, n). I could …

Total answers: 2

System calls involved in stack and heap allocation

System calls involved in stack and heap allocation In the process address space, there is the stack and the heap. When a function is called, or even when a local variable is declared, it uses the stack; the kernel must assign physical address and create the mapping of virtual to physical address; so, a system …

Total answers: 2

Why is the virtual address not 4KiB-aligned when its physical address is aligned to 4KiB?

Why is the virtual address not 4KiB-aligned when its physical address is aligned to 4KiB? Briefly, I have a physical address inside kernel (9,932,111,872 or 0x250000000), which is apparently aligned to 4KiB (page size). When I use the kernel __va() function to get the kernel virtual address, I got something like 0xf570660f (different on each …

Total answers: 1

How can i output the result of "memusage" to a text?

How can i output the result of "memusage" to a text? When i execute a command memusage to check the memory of my program, the result is as follows. I want to output the result in the red circle to a text. How should i do? Asked By: wwb1 || Source You can use grep: …

Total answers: 1

Which is the trigger of OOM killer, free or availaible memory in Linux?

Which is the trigger of OOM killer, free or availaible memory in Linux? I am working on an embedded Linux system which is on SOC platform. I have 2 machines ran the same memory workload, and I got following memory output. Machine 1. total used free shared buff/cache available Mem: 50616 35304 2516 48 12796 …

Total answers: 1

Logging sum of Mem and Swap from free command output

Logging sum of Mem and Swap from free command output In relation to this: https://unix.stackexchange.com/a/754252/582781 Solution 1: free -g -s2 | sed -u -n ‘s/^Mem:s+[0-9]+s+([0-9]+)s.+/1/p’ >> memory.log Is there a way to add Swap to this, so that I would log the sum of used Mem and Swap? Asked By: Aleksander || Source Using AWK: …

Total answers: 1

Why `ru_maxrss` returns more usage than expected

Why `ru_maxrss` returns more usage than expected I’m testing a program runner. When I’m using GNU time 1.9 to test the code below // nul.c #include <stdio.h> #include <sys/resource.h> int main() { struct rusage r_usage; getrusage(RUSAGE_SELF, &r_usage); printf("%ldn", sizeof r_usage); printf("%ldn", r_usage.ru_maxrss); return 0; } compiling with gcc nul.c -o nul and run with /usr/bin/time …

Total answers: 1

Limiting process memory usage with systemd-run not working as expected

Limiting process memory usage with systemd-run not working as expected I’m trying to limit the memory usage of Chrome with systemd-run by starting it with: systemd-run –scope -p MemoryMax=16G -p MemoryHigh=15G -p CPUWeight=70 -p StartupCPUWeight=100 /opt/google/chrome/chrome However this seems to not really work, as I can see it filling up all my 32GB of ram …

Total answers: 1

How could we get the USS of a process

How could we get the USS of a process As far as I know there are several memory concepts: VSS RSS PSS and USS, in which USS(unique set size) is the physical memory exclusively used by a process(correct me if needed). I think this should be a very useful value to let me know which …

Total answers: 1

Why does ftruncate with a shared memory object not use memory?

Why does ftruncate with a shared memory object not use memory? I’ve observed that I can create a shared memory object and give it ostensibly any size with ftruncate, regardless of the resource limits on my system. The code below sets the size to 262 TB, and indeed stat() reports that is the size. However, …

Total answers: 2

Confusion about memory management terminology (Linux)

Confusion about memory management terminology (Linux) I want to know a better way of "naming things" (regarding memory management in linux), to avoid a reader of a writting of mine to misunderstood something, but also avoid long-phrases each time. I call file-backed to a page that, in case of reclaim, can be just discarded because …

Total answers: 1

Who decides the physical address for a particular virtual address, kernel or MMU?

Who decides the physical address for a particular virtual address, kernel or MMU? I am trying to understand how the physical addresses are allocated when running an OS. My question is when the kernel allocates some memory (lets say using kmalloc), who decides what physical memory address range should be mapped for this virtual memory …

Total answers: 2

Linux uses 6.6Gi RAM for nothing

Linux uses 6.6Gi RAM for nothing I’m trying to figure out why my Linux machine is so slow and I found this: $ free –human total used free shared buff/cache available Mem: 7,3Gi 6,6Gi 168Mi 1,0Gi 1,8Gi 746Mi Swap: 9,3Gi 2,7Gi 6,6Gi When I run top -n1 -b -o+RES | head -n20 I can’t see …

Total answers: 1

How to limit Video RAM usage on linux?

How to limit Video RAM usage on linux? some processes on my computer are using way too much video card memory for the tasks they’re doing. I’d like to impose a limit on these tasks to have the OS limit the on-card RAM usage of these tasks. normally, I could use ulimit if the target …

Total answers: 1

Does QEMU on Linux Ubuntu 20.04.1 x86_64 have a memory leak?

Does QEMU on Linux Ubuntu 20.04.1 x86_64 have a memory leak? We have a testbed for an OSv project that runs (5.15.0-72-generic – 20.04.1-Ubuntu – x86_64) the same instances a lot of time. The script for the execution of a single run is very simple and follows: while [ $x -le $t ] do ./scripts/capstan_run.sh …

Total answers: 1

How to check the memory usage in kernel in Linux-5.10.24?

How to check the memory usage in kernel in Linux-5.10.24? I am working on an embedded Linux system with kernel 5.10.24. And there is 96MB DRAM in system. When system boots up, I checked the memory usage and got followings. # dmesg | grep "kernel code" [ 0.000000] Memory: 85888K/131072K available (7885K kernel code, 692K …

Total answers: 1

User friendly way to apply BadRAM patterns

User friendly way to apply BadRAM patterns My Linux machine is having issues with faulty RAM. I ran PCMemTest-64, and I determined the following patterns: Now, I have stock Ubuntu which doesn’t seem to have the BadRAM patch, and I’m a bit nervous about compiling Linux from scratch. So I’m wondering if there is an …

Total answers: 1