Best memory management algorithms books according to redditors
We found 20 Reddit comments discussing the best memory management algorithms books. We ranked the 9 resulting products by number of redditors who mentioned them. Here are the top 20.
We found 20 Reddit comments discussing the best memory management algorithms books. We ranked the 9 resulting products by number of redditors who mentioned them. Here are the top 20.
Think Like A Programmer is the exact book you're looking for.
If you want more than an overview:
https://www.amazon.com/Garbage-Collection-Handbook-Management-Algorithms/dp/1420082795
Or, if you're on a budget, the previous edition can be had for under $20 used:
https://www.amazon.com/Garbage-Collection-Algorithms-Automatic-Management/dp/0471941484
What can be even cheaper is to pick a recent GC paper (e.g. https://www.cs.utexas.edu/~speedway/fp031-kermany.pdf) and then follow the citations back in time. Often if you google the author and the name of the paper, you'll find a .edu hit on the first page of google that has the paper as a PDF for free (either the author(s) themselves host it, or a professor teaching a class posted it for their students to read).
For basic background, read:
https://en.wikipedia.org/wiki/Cheney's_algorithm
and
https://en.wikipedia.org/wiki/Tracing_garbage_collection#Basic_algorithm
As Cheney's algorithm and tri-color marking are two of the basic building blocks for many other GC algorithms.
Unlike some other topics in CS, garbage-collection papers tend to not invent their own mathematical notations for describing their algorithms, and they tend to be more empirically focused (since worst-case bounds on most novel GC algorithms are not particularly interesting). Those two things make the papers quite approachable.
No, a conservative non-generational GC is not "decent".
Step 1. Buy this book:
http://www.amazon.com/Garbage-Collection-Algorithms-Automatic-Management/dp/0471941484/ref=pd_bbs_sr_1?ie=UTF8&s=books&qid=1239472447&sr=8-1
Step 2. Implement a decent GC (look at Ocaml, Sun JVM, or SBCL for examples)
Step 3. Post on social networking sites telling people about MRI's "decent" GC
Stephen Palmer, Vision Science: From photons to phenomenology
http://www.amazon.com/Vision-Science-Phenomenology-Stephen-Palmer/dp/0262161834
It’s gonna be hard to give you much without picking a specific OS—details can vary widely even within a single OS family line—but an OS book is probably a good place to start. Tanenbaum’s book is the go-to.
Alternatively, there are books on specific techniques like garbage collection, or books more generally on programming for UNIX/POSIX/Linux or Windows (via Win16/32/64 API, not the six-mile-high shitheap piled atop), which would tell you some about how memory management works in down at least to whatever abstract hardware interface the kernel uses.
This may not be exactly what you were asking for, but as someone who's interested in both philosophical aesthetics and design, I've found basic color theory and vision science a very useful thing to learn about. Here's a great vision science book that keenly engages our experience of the world.
Another completely different source of inspiration I've found for thinking about abstract principles in aesthetic experience has come from Scott McCloud's book Understanding Comics. It really does explore a bunch of complex ideas about how we can piece together a beautiful/ugly/complex/dynamic/static/etc. picture of the world from two dimensional images. It's not just about comics at all.
This is not a good approach to garbage collection, but it's the best you can do, sans optimization, for a language like C. It's not unsafe if done correctly since you err on the side of caution and assume anything that could be a pointer is a pointer. It is quite slow and will leak some memory over time (due to misclassifying integers as pointers), which is why languages that are designed for garbage collection use more efficient designs requiring cooperation from the language.
If you're interested in the stuff, I highly recommend The Garbage Collection Handbook. It's loaded with information and algorithms but also includes approachable, pragmatic discussion of the characteristics and tradeoffs of automatic memory management systems.
I found this super helpful.
https://hackernoon.com/14-patterns-to-ace-any-coding-interview-question-c5bb3357f6ed
https://medium.com/leetcode-patterns
https://www.amazon.com/Think-Like-Programmer-Introduction-Creative-ebook/dp/B008RQMDU4
The problem is youre not thinking fast enough or not identifying patterns a lot of questions are solved exactly the same.
Hopefully a book that has a high utility but low incidence of suggestion:
Garbage Collection: Algorithms for Automatic Dynamic Memory Management
I had been writing garbage collectors for a year or so before getting this book, and it really changed the way I think about resource allocation on a computer. It's a topic that I don't think is as broadly applicable as some of your other suggestions, yet it's one which turns out to be applicable for a wide variety of problems--it teaches a certain class of patterns that you can use even if you never write a garbage collector.
> of course. except that c++ allows you to use values that are stack-allocated and unboxed whenever you wish for it. (which should really be the vast majority of the time. one notable exception are standard containers, but if you're writing your own container library, your programming license needs to be revoked anyways.)
But you just showed us the use of an auto_ptr to get past GC problems. They manage heap objects.
> this is orders of magnitude better than copying gigabytes of tiny, fragmented, heap-allocated objects for each garbage collection pass, trust me.
Generational collection.
Here's a great book. Expensive as hell, though.
I would start with this survey by Wilson. It introduces a number of simple approaches and refers to the papers that first came up with them. There's also The Garbage Collection Handbook which goes into significantly more depth.
My advice for your language is to start with a simple mark and sweep collector. Make sure you can configure how often collections are run and can make dumps of your heap whenever you want to -- you'll be in debugging hell otherwise. Once you're done with that, switching to a copy-collector and then implementing incremental collection via a read-barrier or a write-barrier is a logical next step.
Finally, don't worry about microoptimisations (yet). Garbage collectors are a terrible pain to debug even when your code is clear; if your code is clever, you'll never figure out what's going wrong.
It's on my bookshelf, although currently reading more on emergent phenomena, such as Philip Ball's Critical Mass: How One Thing Leads to Another and some books on game theory. GEB, of course, was a big influence too :)
Regarding perception, I still tend to refer to my undergrad perception textbook Vision Science: Photons to Phenomenology. It's highly readable, even if you're not a specialist, although if you are interested in something more easy to digest, there is Richard Gregory's seminal book Eye and Brain, which is a great introduction to vision science and perception.
I worked through the following books:
The C Programming Language (the one you mentioned).
It's a classic for a reason! It might not be completely up to date (which is a common complaint), but once you work through this book becoming up to date doesn't require much effort. You learn a lot about the core C language with this book, which is very helpful. Lots of challenging exercises (make sure to do as many as you can!)
Data Structures in C - Kalicharan
I really like this one because it's absolutely packed with exercises, it's also very short (300-ish pages) and it takes a much more practical approach to learning about data structures and some basic algorithms using C. I wouldn't pay too much attention to the 3.5 review - one guy gave it a 1-star because of the font (okay, the font is a little cartoony I guess, but that's not worth dropping the whole book down to 1) and another complains about the book being sold under a newer edition with the same ISBN, which is a bit whacky I guess, but again, doesn't really talk about the content of the book itself. It has loads of code and a shitload of exercises to help reinforce knowledge.
Finally, I really liked Understanding and Using C Pointers - Reese.
This is another great short/concise book (~220 pages) and it will really help to iron out any mental rough spots you might have in regards to pointers. 'The C Programming Language' does go into pointers, but this tiny book really helped completely flesh them out for me and went into more advanced scenarios.
With the above books I really felt like I got a very thorough education in C and the great thing was none of them bog you down in academia, they are all very short and practical for every day developers.
The books posted are great for 3D rendering.
However, you're a flash developer and I'm concerned about your proficiency level with C++. If you're meh at C++, then I recommend that you write some sample C++ code to get the hang of C++ before you dive into implementing 3d mathematics and rendering.
Some resources for C++:
http://www.amazon.com/C-Pointers-Dynamic-Memory-Management/dp/0471049980
Although the best way to get good at C++ is to just code in C++! :)
Also you need a strong foundation in 3D math before getting to the rendering:
http://www.amazon.com/Primer-Graphics-Development-Wordware-Library/dp/1556229119
Course Name: Evolutionary Computation & Genetic Algorithms, Artificial Neural Networks and Machine Learning
Course Link: can't find them
Text Book: We used this for neural networks its a really good introductory text to most of the common types of network
Book: https://www.amazon.com/Garbage-Collection-Handbook-Management-Algorithms/dp/1420082795
Article that helped me a lot: https://journal.stuffwithstuff.com/2013/12/08/babys-first-garbage-collector/
Let's add to the stack. Two books I like are by Steve Allen: [[Dumbth](https://www.amazon.com/Steve-Allen-Bible-Religion-Morality-ebook/dp/B002TUSCNQ/ref=pd_sim_351_1?_encoding=UTF8&pd_rd_i=B002TUSCNQ&pd_rd_r=ed5e88cd-ea7c-11e8-a62f-ebaf1168255c&pd_rd_w=azu7h&pd_rd_wg=QVfIC&pf_rd_i=desktop-dp-sims&pf_rd_m=ATVPDKIKX0DER&pf_rd_p=18bb0b78-4200-49b9-ac91-f141d61a1780&pf_rd_r=J6RMGHZ490X0YRAKT5G2&pf_rd_s=desktop-dp-sims&pf_rd_t=40701&psc=1&refRID=J6RMGHZ490X0YRAKT5G2)](https://www.amazon.com/Steve-Allen-Bible-Religion-Morality-ebook/dp/B002TUSCNQ/ref=pd_sim_351_1?_encoding=UTF8&pd_rd_i=B002TUSCNQ&pd_rd_r=ed5e88cd-ea7c-11e8-a62f-ebaf1168255c&pd_rd_w=azu7h&pd_rd_wg=QVfIC&pf_rd_i=desktop-dp-sims&pf_rd_m=ATVPDKIKX0DER&pf_rd_p=18bb0b78-4200-49b9-ac91-f141d61a1780&pf_rd_r=J6RMGHZ490X0YRAKT5G2&pf_rd_s=desktop-dp-sims&pf_rd_t=40701&psc=1&refRID=J6RMGHZ490X0YRAKT5G2) and Steve Allen on the Bible, Religion and Morality. The latter is the book that gave me the nudge toward de-conversion.