I'll be honest with you, I don't really know either. The transpiler and lua system libraries aren't made by me and I haven't really looked at them all that much other than making some small changes here and there so they work properly in warcraft III.
Anyways, you could try forcing the garbage collector to run and see if that helps. You can do this by putting the following code in your map:
C#:
[NativeLuaMemberContainer]
internal static class LuaMethods
{
[NativeLuaMember("collectgarbage")]
public static extern void RunGC();
}
PS. You can enable C# highlighting with [Code=CSharp]
No luck, but garbagecollection seems to be really working tho. Possibly coding is bad ;(
Surprisingly, with garbage collector in place, I was able to make performance tests - spawn units very fast(0.01) and kill them instantly, after 5 hours of running Warcraft 3 running perfectly fine, but I was 7.8GB in memory size. The game was smooth and perfectly fine, everything was functioning just fine, no lag, stable hardcapped 120 fps, systems like damage parsing, regeneration handle were running just fine. What could be the problem? Ideas?
The whole code from there would be as follows
Azureus0/NoxRaven
Indexer code is in UnitEntity. As I was writing this I had a test with code which did not use any delegates in indexing code.
It seems to leak less.
In the end, I'd like to say that if C# compiler to war3lua wasn't so buggy, hands down 20/10 would use it no-brainer. Best platform. Because it supports all the magic of the modern high-level language, like polymorphism, overrides and even damn reflection! REFLECTION CARL! Tested myself, Activator.CreateInstance(Type, arguments) returns new Type(args)! There is literally nothing impossible with C# compiling to lua if it worked correctly tho.

But currently it has 'magical' problems which make no sense. For example,
C# generated code executes this command in a weird way. This piece of code stops unit animation (not reset), but supposed to, well, "attack".
Lua:
SetUnitAnimation(War3MapTimeAbyssSource.GlobalVars.shop_charpower, "attack")
This natively generated code does what it is told.
Lua:
SetUnitAnimation(gg_unit_n001_0024, "attack")
Don't point out code order execution. This piece comes right after previous statement and it works.
Lua:
SetUnitAnimation(War3MapTimeAbyssSource.GlobalVars.shop_charpower, "Attack")
AddUnitAnimationProperties(War3MapTimeAbyssSource.GlobalVars.Castle, "work", true)
AddUnitAnimationProperties(War3MapTimeAbyssSource.GlobalVars.gg_unit_hbla_0033, "work", true)
AddUnitAnimationProperties(War3MapTimeAbyssSource.GlobalVars.gg_unit_hlum_0038, "work", true)
I really like this since I'm a C# programmer and like to make stuff in Warcraft III. I can follow the instructions and set this up by myself just fine.
It would be nice if you could set this up faster. You could reduce the complexity of the setup by creating a C# program that does it automatically or maybe there are other ways.
If you are C# dev you should know best, that ideal project setup looks like blank project without a single reference and you go figure what you need for thing to run (true story btw).
I think the best way he can make it better is to trash the whole repo with the example project and create a new one with all required submodules and infrastructure in place, so that all you'd need to do to get started is clone repo recursively and setup string provider. done.