Hello all,

I have been away for a while. I started writing my own version of parrot (or at least chunks of it) so I can get a feel for the current parrot internals. I have learned a lot and now realize why some things were done the way they were.

I am on memory management now and my implementation is different from that of parrot. I would just like to outline it so that if there is any interest in the code I can provide it to you. I'm not suggesting that parrot implement this technique, but it may spur the creative thinking in someone with their fingers already in the cookie jar.

First of all it looks as though there is no one perfect memory management technique. There are a lot of papers and several different techniques. An individual technique may be close to optimum for a certain type of application, but may be poor in another. Even in the same program some chunks of memory may be highly dynamic, while others are fairly static. So I figure that there is no reason to treat all memory the same, I would like future advances to just plug in, I don't want to force a hard-coded memory management scheme on someone who knows exactly what they want.

So my implementation has an "interface" called Memory Manager (written in c). Each instance of a Memory Manager implements certain memory management functions. The remainder of the program addresses each manager in the same way. However, each manager is free to allocate, store, read ,and free memory in its own way. In each program there can be several memory managers created, each using there own management technique. Variables of certain types or meeting certain criteria can be directed to the optimized (or specialized) memory manager for that type.

This also opens up the possibility of allocating memory storage space in a file, or on a database, or in another interpreter using something like soap. An implementation of a memory manager could itself be bytecode as long as it implements the managers interface. This would make it a nice platform to experiment with or find the optimum technique for your program before you distribute it. It would allow you to run the same program code, but with different plug in memory managers. Of course those that don't want to deal with it can just ignore it and it will use a default manager.

There is some talk about memory manager that learn, or expert systems. When these technologies develop, it would be nice if parrot could just plug in a new AI Memory Manager.


Erik


Reply via email to