Skript: Still memory leak

Created on 22 Dec 2018  路  11Comments  路  Source: SkriptLang/Skript

Description


Local variables still causes memory leaks

Steps to Reproduce

command /test:
  trigger:
    set {_i} to 1
    set {test} to true
    while {test} is true:
      add 1 to {_i}
      loop 1000 times:
        set {_test::%{_i}%::%loop-number-2%} to random number between 1 and 999999999
        send "Ram: %total ram - free ram% MB / %total ram% MB"
      wait 1 tick

command /stoptest:
  trigger:
    set {test} to false

Server Information

  • Server version/platform: 1.12.2
  • Skript version: 2.3-beta4
bug medium

Most helpful comment

Alright, now this is looking troubling. Edit: did quick re-release of hotfix, please check if it helped.

All 11 comments

ok i found it...

set {_test::%loop-number-2%} to random number between 1 and 999999999 #works

leak

set {_test::%{_n}%::%loop-number-2%} to random number between 1 and 999999999

Working as intended. You're not exiting the trigger until you use /stoptest, thus local variables are not removed. The "fix" you found relies on the script overwriting existing variables instead of creating new ones.

@bensku after type /stoptest RAM memory stays at for example at 2Gb and it will never decrease until the restart.

JVM does not necessarily free RAM to OS, at least not until version 12 (see https://openjdk.java.net/jeps/346). Unless the expressions you use to get information about RAM have confusing names and refer to heap instead of physical memory, this is not an issue with Skript.

@bensku
leak1
leak2

Alright, now this is looking troubling. Edit: did quick re-release of hotfix, please check if it helped.

@bensku tested, issue still exists. I have no idea why.

Cannot reproduce. I did find a (relatively unlikely) memory leak, but if was fixed by commit 237b3dd.

@TheBentoBox Did you find a way to reproduce this?

No, I just labelled it since it has been sitting for months unlabelled and with no activity, but if we're not going to do anything until someone comes back with reproduction steps then we should probably just let that be reported as a new issue and close this one.

No one has been able to reproduce this with recent Skript versions, so closing.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

cyanide43 picture cyanide43  路  4Comments

Romitou picture Romitou  路  3Comments

Anarchick picture Anarchick  路  3Comments

MrScopes picture MrScopes  路  3Comments

Coolfire02 picture Coolfire02  路  3Comments