[sldev] Script/Parcel/Memory Limits

Kitty sldev at catznip.com
Fri Dec 18 10:46:27 PST 2009


Each time I bring this up it seems quite a few people are unaware and are
trying to play memory tricks to save a few bytes here and there when Mono
tends to "waste" whole Kb's at a time per script without a way to really
tell or optimize for it because there isn't a way to look at the bytecode to
see how big each function ends up being.

As far as I can tell:
- data segments are multiples of 512 bytes (ie a script using 1 global
integer variable and one using 50 both use 512 bytes of memory to store them
in)
- each function (or event handler) is placed on a 512-byte boundary (ie a
function with nothing more than llSay(0, "Hello World!"); takes up 512
bytes)

It would be helpful to get some kind of (semi-)official confirmation of the
above and just how Mono is compiled and how things are laid out in memory
and if there are any plans to address it (some padding is always needed but
why so much per function?).

The data segment alignment isn't that big of a deal but the total amount of
memory "wasted" by padding each function to be a multiple of 512 bytes can
add up to quite a bit per script.

Kitty



More information about the SLDev mailing list