When running a Memory Analysis on my server, I found that Skript Aliases were taking up 49.6MB in 1.2M objects


Odd thing is that some aliases are duplicated many times



May not be a large bug, but seems inefficient to have 1.4k copies of trapdoors stored
Just run a server with Skript, and then dump the heap after it's done with loading
Used Eclipse Memory Analyser
Really strange that some of the trapdoors are storing more dupes than others too.
The aliases should be guarding against storing duplicate entries like this.
I investigated this, and found no obvious memory leaks. Still, I managed to optimize a bit.
Let's look at those duplicate Minecraft id strings first. JVM string deduplication should take care of most of the overhead, but not all of it. I've applied String.intern() on them, which might help a bit.
I've implemented deduplication, which removes most of unnecessary memory usage. Still, there are many aliases; they do consume quite a lot of memory.
New release with my changes is out. Does it help with memory usage, @Wealthyturtle?
@bensku will get back to you in 24 hours :)


Can confirm that it's been optimized! @bensku
By the way, please check out #2246 :/
Accidentally tagged this instead of #2396
Most helpful comment
New release with my changes is out. Does it help with memory usage, @Wealthyturtle?