[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: P-Source: A Guide to the Apple Pascal System



Paul Schlyter wrote:

[snip]

Yeah. I'm interested to see how you manage the heap - with so little
space it could potentially thrash really badly. The p-system got
around this problem by 'disposing' the dispose procedure and simply
having a stack instead, but for Java that's not an option.

One option in Java is to *never* release allocated memory blocks.
Most versions of javacard takes this approach.  So if you write
software in Java for the javacard environment, you'll have to
think very carefully before allocating anything, or else you may
soon run out of memory!

(javacard is an interpreter for a subset of Java intended to run
on smartcards, i.e. small chips embedded into credit card size
cards. The chip doesn't have any power source of its own but gets
powered only when inserted in a card reader.  The java classes in
this environment will have a lifetime equal to the lifetime of the
card)

Matt



I think an extremely simplistic memory manager would make the environment a little too restrictive. I currently have a reference counted handle based manager with compaction and optional swapping to file (not quite figured out). A trade-off from a simple malloc/free implementation and a full mark and sweep garbage collector. I hope it works well because implementing another memory manager in assembly would suck. I wanted a way to swap memory to a file to give the environment the ability to run a decently sized (relatively speaking) app. The issue with a handle based approach is that the handle table itself takes up a some space. Finding the right size for the table will take some time.

Dave...