Island Memory-usage issue in my App

Hey guys,

During my development of the handmadehero, I reached a point where I would like to know, if I have made a some sort memory-leak somewhere in my code or is it maybe islands internal stuff that produces a little bit more overhead at runtime, i really cant know, so my question is am I able somehow to reduce the memory-usage of my .exe when I work with internally created bitmap-allocators?

Best regards

Shpend

The overhead of an elements object is 1 pointer + whatever Boehm requires. so if you have something like:

MyClass = public class
private
fValue: Int32;
end;

Allocates 8 bytes on a 32bits platform.

Hmm, so fValue = 4byte + pointer=4byte = 8byte?

And another thing I wanted to ask, the .exe is 735KB large, i am using some win32 api code, yes, but isnt this not to large, what do you say?

And I have another testing-island-app, and there is really nothing but a “case of” involved and ofc the main() method, and the binary is 1MB large.

Yes. I use a pointer to store the vmt (pretty much all object oriented languages do that). A pointer is 8 bytes on a 64bits target.

I’m saying there’s an RTL and GC compiled in, and there’s rtti that lets you discover things. Those things use space.

The thing is, I googled how much a .NET .exe eats up in size and most of them should be larger than a island-app, because I guess that .NET has vastly more overhead than island. And they are all 300-500KB, but not >= 1MB and I dont have any “uses RTL…” or types in it.

Why are they compiled in, when I dont make any use of them?

There are a few things here. First of, .NET has a runtime that’s usually already installed, if not it’s about 300 mb for .net 2, newer versions are most likely larger. Your app uses that and does not link it in.

With Island applications you need a custom RTL (ie our Island RTL) and that generally gets linked in. We do support dynamic linking, but usually that’s not worth doing due to the size of the RTL.

An empty Island/Windows app takes 315 kb (which includes the RTL and GC code) in Release mode. In debug it’s about 900kb, but debug doesn’t optimize any code on purpose, and actually includes debug info, hence the size.

1 Like