UNIT 8 Flashcards

1
Q

There are three goals that must be achieved whenever dealing with main memory:

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Java programs run faster than their C++ counterparts because Java has automatic memory management and C++ does not

A

False, this actually make Java programs run slower.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Memory leaks could result in a crash on consoles, slow game execution on PC playforms, and bugs that are hard to detect.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

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.

A

False

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

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.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Memory fragmentation happens when contents of a big memory block are divided into smaller chunks and scattered around in the memory (virtual addressing).

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

As a consequence of memory fragmentation, the system will slow down and eventually crash.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Static memory allocation wastes memory and does not help complex class inheritance.

A

True

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Three goals when dealing with main memory

A

Safety, knowledge and control

How well did you know this?
1
Not at all
2
3
4
5
Perfectly