To artificially make your Debian system use 4 GB of RAM, you can use a simple memory stress test. The easiest way is to use the stress-ng tool, which is designed for this purpose.
stress-ng:Install stress-ng (if not already installed):
bashsudo apt update sudo apt install stress-ng
Run stress-ng to Allocate 4 GB of RAM:
bashstress-ng --vm 1 --vm-bytes 4G --vm-keep
--vm 1: Spawn 1 worker to allocate memory.--vm-bytes 4G: Allocate 4 GB of virtual memory.--vm-keep: Keep the memory allocated until the process is manually stopped.Stop the Process:
Press Ctrl+C to stop the process and release the memory.
dd to Allocate MemoryIf you don't want to install stress-ng, you can use dd to allocate memory:
bashdd if=/dev/zero of=/dev/shm/fill bs=1M count=4096
/dev/shm (shared memory), effectively using 4 GB of RAM.bashrm /dev/shm/fill
free -h).Vibe can make mistakes. Check answers. Learn more