Java heap terminology: young, old and permanent generations?

I’m trying to understand What the concepts of young, old and permanent generations are in the Java heap terminology, and more specifically the interactions between the three generations. My questions are: What is the young generation? What is the old generation? What is the permanent generation? How does the three generations interact/relate to each other? … Read more

Node.js heap out of memory

Today I ran my script for filesystem indexing to refresh RAID files index and after 4h it crashed with following error: [md5:] 241613/241627 97.5% [md5:] 241614/241627 97.5% [md5:] 241625/241627 98.1% Creating missing list… (79570 files missing) Creating new files list… (241627 new files) <— Last few GCs —> 11629672 ms: Mark-sweep 1174.6 (1426.5) -> 1172.4 … Read more

How to deal with “java.lang.OutOfMemoryError: Java heap space” error?

I am writing a client-side Swing application (graphical font designer) on Java 5. Recently, I am running into java.lang.OutOfMemoryError: Java heap space error because I am not being conservative on memory usage. The user can open unlimited number of files, and the program keeps the opened objects in the memory. After a quick research I … Read more

Error java.lang.OutOfMemoryError: GC overhead limit exceeded

I get this error message as I execute my JUnit tests: java.lang.OutOfMemoryError: GC overhead limit exceeded I know what an OutOfMemoryError is, but what does GC overhead limit mean? How can I solve this? 22 s 22 This message means that for some reason the garbage collector is taking an excessive amount of time (by … Read more

Why should C++ programmers minimize use of ‘new’?

I stumbled upon Stack Overflow question Memory leak with std::string when using std::list<std::string>, and one of the comments says this: Stop using new so much. I can’t see any reason you used new anywhere you did. You can create objects by value in C++ and it’s one of the huge advantages to using the language. … Read more

What and where are the stack and heap?

Programming language books explain that value types are created on the stack, and reference types are created on the heap, without explaining what these two things are. I haven’t read a clear explanation of this. I understand what a stack is. But, Where and what are they (physically in a real computer’s memory)? To what … Read more