ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
On Windows platform m$ provides a set of APIs that manages virtual memory. I consulted Linux man, but could not find such topics.
I can use malloc to allocate a large block of memory that is larger than system's physical memory. I want to know if there are a *special* set of APIs to manage virtual memory in Linux?
All in /proc are not real files on disk. But a way to read or set kernel configuration.
E.g. To make your system swap less and increase tendency to keep more processes in RAM, lower the contents of /proc/sys/vm/swappiness:
Code:
# Seems to have 0 bytes:
ls -l /proc/sys/vm/swappiness
-rw-r--r-- 1 root root 0 Jun 4 11:12
# Yet not empty:
$ cat /proc/sys/vm/swappiness
60
# Make system swap less:
echo 30 > /proc/sys/vm/swappiness
# Check to see the change:
$ cat /proc/sys/vm/swappiness
30
Get an overview of the memory management techniques that are available to Linux™ programmers, focusing on the C language but applicable to other languages as well. This article gives you the details of how memory management works, and then goes on to show how to manage memory manually, how to manage memory semi-manually using referencing counting or pooling, and how to manage memory automatically using garbage collection.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.