avian icon indicating copy to clipboard operation
avian copied to clipboard

Avian can't use more than ~2GB of heap space

Open dicej opened this issue 12 years ago • 6 comments

We're using 32-bit integers (signed in some cases) all over heap.cpp to represent sizes, so we overflow when we get close to 2^31. We should replace these fields and variables with 64-bit integers.

dicej avatar Mar 07 '13 00:03 dicej

I would say it's actually more appropriate to replace it with something like intptr_t, uintptr_t, or size_t. That way, we don't waste space or cycles on 32-bit platforms.

joshuawarner32 avatar Mar 07 '13 00:03 joshuawarner32

On Wed, 6 Mar 2013, Joshua Warner wrote:

I would say it's actually more appropriate to replace it with something like intptr_t, uintptr_t, or size_t. That way, we don't waste space or cycles on 32-bit platforms.

Agreed.

dicej avatar Mar 07 '13 00:03 dicej

This makes avian pretty much unusable for me.

Techcable avatar Nov 24 '15 16:11 Techcable

@Techcable - could you describe your use-case a little more?

Keep in mind that even if we bump the integer sizes, it's unlikely the GC algorithm will scale to large heap sizes anywhere near as well as e.g. hotspot's will.

joshuawarner32 avatar Nov 24 '15 16:11 joshuawarner32

Couldn't you use reference counting and garbage collection?

Techcable avatar Nov 26 '15 05:11 Techcable

Avian does use garbage collection. Only toy VMs can really get away without it (and PHP, apparently, but that's another story). Essentially, the problem is that the Avian's GC algorithm, which is a fairly basic generational copying collector, hasn't had anywhere near the amount of tuning that many other VM's garbage collectors have had.

Reference counting, in it's most basic form, will likely make things worse in all but the largest heaps, far beyond the capacity of even HotSpot's GC - we're talking hundreds of GB here. There are some variants of reference counting that start to be competitive on smaller heap sizes (what Avian is designed for anyway), but those get dramatically more complicated - so we come back to the matter of how much effort has been poured into development. It hasn't been a priority, and even then, it's not clear it would be a net win.

So, I ask again - could you describe your use-case a little more?

joshuawarner32 avatar Nov 30 '15 15:11 joshuawarner32