Writing a memory manager in a managed language?

Jikes RVM, metacircular java runtime, seems to have its own Allocator / Collector, written in Java (MMTK).

How does it work when your garbage collector requires the garbage collector to start? From the look at the code, I did not see that MMTK limits itself to any particular subset of Java, but it seems to me that if your code intended for allocating managed memory needs to allocate managed memory to run, it goes into recursive rotation until it will explode.

But MMTK obviously works, and apparently some others use it. How is it possible to write a memory allocator and GC in a managed language like Java?

+5
source share
2 answers

Here are some examples of this. I am not familiar with the Jikes implementation, but I read on both Java projects and PyPy. Most of them have a common division of things into two levels: the runtime / interpreter level and the application level. Each level has its own objects, exceptions, thread of execution, etc.

When you think of it abstractly, it is actually easier to understand. The runtime can be recorded using memory or not, at a low level or at a high level, necessarily or functionally. It does not really matter. The important thing is that this is the function that it does. Ultimately, it translates into machine code, and all machine codes are the same for the machine. This code accepts operation codes and data as input, predetermines actions based on them, manages resources, etc.

. , , . . runtime , , , . GC-, GC, GC... , ENIAC.;)

, , Jikes, ( ). , GC, GC. , . . . GC GC - : .

. GC GC-based runtime, . , , , , GC GC . GC , , . GC GC , GC, .

- . . .

+1

:
 - " , ?"
 - " ! ( , , , .)"

C , , C. ? , , , , --, ( 18- DEC PDP-15), . , , , , .

0
source

All Articles