Memory leak with JavaObject

I use library log4j for logging, but I have the problem with memory leak.
Memory increase every time when we call next code

Object jog = JavaObject.InvokeStaticMethod("org.apache.logging.log4j.LogManager", "getRootLogger", {}) //it calls one time with initialization
log.InvokeMethod("info", {"some msg"}) //it calls every time when we logging

I checked other lib like com.google.gson.GsonBuilder but situation is the same. How to solve this problem, why javaobject don't clear old objects with destructor.
Tagged:

Comments