Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using mdconfig type swap is much faster than type malloc #32

Merged
merged 1 commit into from
Dec 31, 2019

Conversation

allanjude
Copy link
Contributor

No description provided.

@PrivatePuffin
Copy link
Owner

Interesting, the name "swap" implies it's not a ramdisk, but it actually is?

@allanjude
Copy link
Contributor Author

It is a ramdisk that can be swapped out under memory pressure. Whereas 'malloc' uses the kernel malloc facility, which is unswappable, meaning you can run your system out of memory.

Obviously I preferred the malloc version, but it turns out to be significantly slower.

             malloc  Storage for this type of memory disk is allocated with
                     malloc(9).  This limits the size to the malloc bucket
                     limit in the kernel.  If the -o reserve option is not
                     set, creating and filling a large malloc-backed memory
                     disk is a very easy way to panic the system.

             swap    Storage for this type of memory disk is allocated from
                     buffer memory.  Pages get pushed out to swap when the
                     system is under memory pressure, otherwise they stay in
                     the operating memory.  Using swap backing is generally
                     preferred instead of using malloc backing.

@PrivatePuffin PrivatePuffin merged commit 798b693 into PrivatePuffin:master Dec 31, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants