Bad Query Causing Increased Memory Usage

v7.9.12 I ran a bad query with the database tool. It eventually timed out, Ignition’s memory usage went from 500-800mb to 1.2gb-2.9gb and it’s not going back down. It’s been about 15min since the bad query. Is this normal, or does something else need to be done?

It’s only a problem if this memory has truly leaked and will never be recovered, but it may be too soon to tell.

If you have a tool like VisualVM installed on the gateway machine you can use it to request the JVM does a full GC.

You can also try running a script in gateway scope that invokes System.gc().

1 Like

VisualVM says that it needs a Java JDK to run, so I probably won’t mess with it until later. The system.gc() errors out saying object has no attribute 'gc' while trying to run it as a gateway script in a project. I’m assuming a gateway restart would fix it, which is probably what I will have to do.

You probably need to import System first:

from java.lang import System


Something like this…

1 Like

That did run, but I didn’t see any impact yet. However, the memory looks like it is going down on its own before I used the system.gc(). it’s now dropping down to 250mb once it gets to about 1.5gb. Not where it should be, but it is improving. I will give it a little more time and see what happens. Appreciate the help.

EDIT I went ahead and restarted the gateway and all is well, I will note your suggestions in case I act like a bonehead again :slight_smile:

Nothing to be concerned about here.

1 Like

Note that system != System.

1 Like

Yep I noticed that and used it as such. I guess I got a little lazy while typing. I did use System.gc() If anyone else comes across this post, it will be good to have that point clear. :+1: