majid hajibaba majid hajibaba - 7 months ago 80
Linux Question

resize physical memory in linux

I wanna to test a program in a system with 512MB memory. But my system has 1GB RAM slot. I don't want use VM or docker. How can I decrease physical system memory in linux by commands such that

free -m
commands show the 512MB size for memory.

I do it before but forget that and cannot find it again.


The mem kernel parameter will allow you to limit the maximum amount of physical RAM visible to the kernel.

kernel=... mem=512M ...