摘要 |
A method and a device for managing a memory are provided to guarantee execution of a real-time thread without preventing garbage collection from delaying the real-time thread by performing the garbage collection after the real-time thread is completed, and guarantee security of thread execution by preventing dangling reference, as a memory area assigned for executing the real-time thread is managed in a heap. A scheduler(31) schedules garbage collection to perform the garbage collection performed or to be performed for a predetermined heap(32) of a memory area(321) after a real-time thread is completed. A garbage collector(33) performs the garbage collection for the heap according to a schedule by using real-time specification for Java. The heap includes a memory area storing objects for executing the real-time thread. The garbage collector deletes the unused objects among the objects stored in the memory area and compacts the undeleted objects in the memory area. The garbage collector determines whether the thread referring to the memory area is found, and deletes the memory area selectively depending on a determination result.
|