In terms of operating system I have seen a few times the term anonymous memory, but I don't really know, what that is.
If someone asks me something about it I couldn't really say something with great certainty what that is.
I also searched for an explanation of it, but unfortunately I haven't found anything satisfying yet.
Could some just briefly explain me what anonymous memory is, what properties it has? I would also appreciate a helpful link.
Asked
Active
Viewed 3,888 times
5
1 Answers
8
Anonymous memory refers to pages that are not backed by a file. e.g. memory allocated by malloc()
(malloc calls sbrk()
/ brk()
or mmapp()
to ask the kernel for anonymous pages).
Another definition of Anonymous Page: "A page of memory that is not associated with a file on a file system. This can come from expanding the process's data segment with brk(), shared memory segments, or mmap() with a MAP_ANON or MAP_PRIVATE flag. MAP_PRIVATE, although it maps in data from a file, is considered anonymous because any changes do not get written back to the file (any dirty pages have to be moved to swap if the page is freed from main memory)." (from Kernel Newbies: Kernel Glossary)

scottt
- 7,008
- 27
- 37
-
A question just came up. When swapping, how can an operating system take advantage of the knowledge that a page contains non-anonymous memory? – Mar 17 '14 at 17:55
-
@user2965601, you mean besides knowing that the content of the file backed page can be safely dropped? – scottt Mar 17 '14 at 19:30
-
Yes, what would be the advantage? – Mar 17 '14 at 20:40