UNIT 8 Flashcards
There are three goals that must be achieved whenever dealing with main memory:
Safety: We must make sure that our pointer does not go beyond the legitimate boundaries, which would cause the program to crash or read random data.
Knowledge: We must understand our memory usage. That is, we need to know how much memory is used, how much is left, and where our used memory is allocated.
Control: We need to be able to locate related memory objects in consecutive locations to make use of the memory cache.
Java programs run faster than their C++ counterparts because Java has automatic memory management and C++ does not
False, this actually make Java programs run slower.
Memory leaks could result in a crash on consoles, slow game execution on PC playforms, and bugs that are hard to detect.
True
While C++ allows us to know how much memory has been allocated and which object has allocated them, Java is better at predicting when we are running out of memory and the objects that are responsible.
False
Allocating objects that are closely related to each other improves system performance, which is one of the benefits of having full control over memory management.
True
Memory fragmentation happens when contents of a big memory block are divided into smaller chunks and scattered around in the memory (virtual addressing).
False, memory fragmentation happens in main the memory (as well as in secondary storage) as a result of the dynamic creation and deletion of objects.
As a consequence of memory fragmentation, the system will slow down and eventually crash.
True
Static memory allocation wastes memory and does not help complex class inheritance.
True
Three goals when dealing with main memory
Safety, knowledge and control