4 ms·
This project uses reference counting to deallocate memory, so memory is being freed when it is no longer used. However, the paradigm you're referring to is int
by openasocket 10y ago
This project uses reference counting to deallocate memory, so memory is being freed when it is no longer used.
However, the paradigm you're referring to is interesting. Short-living processes that allocate little memory could work. Also, servers could use this model: create a slab of memory for each request, and allocate memory on that slab when processing the request. When the request is completed, you can free the entire slab at once. I know the Ur language does something like this.
- pjmlp 10y agoThis is called regions and was quite common a few decades ago.
- Kristine1975 10y agoWhich are used by Bone Lisp: It uses explicit regions instead of garbage collection. Explicit regions are both very simple and very fast, but how far can one get with them? I want to find out, so I am developing this interpreter. So we've come full circle.
- pjmlp 10y agoTo come full circle we would need people to accept the great research done at Burroughs, DEC/Olivetti, Royal Navi, Xerox PARC, Genera, ETHZ, MSR... in what concerns safe systems programming.
- fsloth 10y agoBut are there any non-paywalled digital accesspoints to this?
- pjmlp 10y agoLots of them. All research of Interlisp-D, Smalltalk and Mesa/Cedar at Xerox PARC: https://archive.org/details/bitsavers_xerox https://archive.org/details/bitsavers_xerox Stéphane Ducasse also maintains the original Smalltalk manuals on his legacy books: http://stephane.ducasse.free.fr/FreeBooks.html http://stephane.ducasse.free.fr/FreeBooks.html Oberon at ETHZ: http://www.ethoberon.ethz.ch/books.html http://www.ethoberon.ethz.ch/books.html If you want to see how the latest incarnation of Oberon used to look like: http://www.progtools.org/article.php?name=oberon§ion=compilers&type=tutorial http://www.progtools.org/article.php?name=oberon§ion=com... For Modula-3 it is a bit harder, because of DEC/Olivetti being acquired by Compaq, which was then acquired by HP. So lots of sites are full with broken links. So the older books are a better source than the Internet. But still you can get some info here: http://www.modula3.org/ http://www.modula3.org/ http://ftp.labs.hp.com/ftp/pub/dec/SRC/ http://ftp.labs.hp.com/ftp/pub/dec/SRC/ http://www-spin.cs.washington.edu/ http://www-spin.cs.washington.edu/ Burroughs overview: http://www.smecc.org/The%20Architecture%20%20of%20the%20Burroughs%20B-5000.htm http://www.smecc.org/The%20Architecture%20%20of%20the%20Burr... It lives on as Unisys MCP mainframes. There are some more informations when searching for it. Algol-68RS used at Royal Navy: https://en.wikipedia.org/wiki/ALGOL_68RS https://en.wikipedia.org/wiki/ALGOL_68RS This is just a small taste. If one cares about history of computing there are lots of other resources scattered around the web and libraries.
- fsloth 10y agoCool, thanks!
- treerex 10y agoI did this 20 years ago. My allocator had multiple regions (slabs) that were tuned to specific allocation patterns and lifetimes, with different algorithms for managing block size, fragmentation handling, and freeing. We could turn on detailed allocation/free logging, which included the file/line the action took place. From this we could put the system under load and then identify allocation hotspots and build models on block size and lifetimes and tune the allocators from that. It was pretty cool.
- tehrei 10y agoApache already does exactly this. (I wrote a small plugin to implement custom authentication for requests via custom headers). You have a hierarchy of memory pools and you can only allocate memory from the pool, or free the entire pool. Usually you just use e.g. the per-request pool and allocate what you need without having to manually free it, since apache frees it for you at the end of the request. If you free a pool, you also free all child pools.
- dfox 10y agoYour take on the server usage of this idea is widely implemented. But the usual approach is not to allocate large block of memory and allocate from that, but to wrap malloc() with function that adds headers that track purpose of the allocated block and then free all still live blocks when the purpose ceases to exists. Both Apache and Samba uses generalized mechanisms for this (apr_pool and talloc, respectively), while PostgreSQL does the same thing in somewhat ad-hoc manner.