How does jemalloc work? What are the benefits?

jemalloc first appeared for FreeBSD, the brainchild of one “Jason Evans”, hence the “je”. I would ridicule him for being egotistical had I not once written an operating system called paxos 🙂 See this PDF for full details. It’s a white paper describing in detail how the algorithms work. The main benefit is scalability in multi-processor and multi-threaded systems achieved, … Read more

How to find memory leak in a C++ code/project?

Instructions Things You’ll Need Proficiency in C++ C++ compiler Debugger and other investigative software tools 1 Understand the operator basics. The C++ operator new allocates heap memory. The delete operator frees heap memory. For every new, you should use a delete so that you free the same memory you allocated: 2 Reallocate memory only if you’ve deleted. In the code below, str acquires a … Read more

How can I declare and use Boolean variables in a shell script?

Revised Answer (Feb 12, 2014) Original Answer Caveats: https://stackoverflow.com/a/21210966/89391 From: Using boolean variables in Bash The reason the original answer is included here is because the comments before the revision on Feb 12, 2014 pertain only to the original answer, and many of the comments are wrong when associated with the revised answer. For example, Dennis Williamson’s … Read more