Skip to content

mmap()-based malloc() implementation for fun and wasted memory

License

Notifications You must be signed in to change notification settings

mdukat/mmap-malloc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

mmap-malloc

mmap()-based malloc() implementation for fun and wasted memory

Purpose

To learn how to implement malloc, check if my theory works, document the code correctly (ptmalloc2 was a great learning material) and get into memory management / kernel hacking.

Example

wget "https://launcher.mojang.com/v1/objects/a028f00e678ee5c6aef0e29656dca091b5df11c7/server.jar"
make
LD_PRELOAD="./mmap-malloc.so" java -jar server.jar --nogui

Benchmark

See Benchmark.md

Current problems

  • Slow (I guess it's due to mutex locking for Block linked list, maybe MAP_ANONYMOUS mmap() calls)
  • Example minecraft server crashes on world generation due to low value of vm.max_map_count kernel parameter. Change the value to 655300 to run the example using sysctl -w vm.max_map_count=655300

About

mmap()-based malloc() implementation for fun and wasted memory

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published