[ SOLVED ] Ignition heap space

Hello, I have a project on vision and I got this error :

Exception in thread "QueryExecuter 2" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space

This is happening and my project is very slow, very slow that I need to close it by task manager, what can I do?

That means your vision project ran out of memory space.

In the designer in project properties under the Vision section, there is a section labeled 'Launching'. In here you can set the initial and maximum client memory usage. Try bumping both of those up a bit and see if that improves anything.

Project Properties

Properties Dropdown

The other thing to do would be to check to see what your project is doing that is consuming so much memory. You might have a memory leak that is eating your memory allocation.

Thank you so much

I found something but what this mean? I think means something about querys from de database that I have.

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
Exception in thread "cron4j::scheduler[bd127c475e4494ce7b88a8a4000001896faed1261e2194ee]::timer[bd127c475e4494ce7b88a8a4000001896faed12646704e0b]" 
Exception in thread "Client_Id_Keepalive" Exception in thread "ClientExecEngine-3" Exception in thread "QueryExecuter 5" Exception in thread "QueryExecuter 2" Exception in thread "QueryExecuter 4" Exception in thread "QueryExecuter 1" Exception in thread "QueryExecuter 0" Exception in thread "persistent-prop-writer" Exception in thread "QueryExecuter 3" java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space
java.lang.OutOfMemoryError: Java heap space

One of your queries might be returning a large amount of data that takes up more space that what you have allocated.

I ran into a similar issue with one of my queries awhile back and had to limit the amount of results it returned to keep it from using too much memory.

Can I have a table with limit results and later use a search button for old information?
Is that possible?

As long as your search button returns less results than needed to use up all your allocated memory you should be fine. If not, you may need to consider tweaking your search query to use a range of some sort (date maybe?) and set a reasonable max interval in your interface. Max interval is going to depend on how many rows you are writing each day. Let the user select the estimated interval they need.

If you need to mass export data, you might need to consider offloading the fetch(query) to the gateway and have your gateway write it to a file on a network drive or similar.

And do you know how to find the query that is the problem? I am still looking and chaging some parts but it does not work very well.

Does the error appear to happen after you open a specific view in the client? Or does it seem to happen a set period of time after opening the client itself? Does it happen after triggering a certain action (did you click a button? submit a form?)

With the case I ran into that I mentioned earlier, it would happen a few seconds after I queued a search for record data with a single filter value. That filter would return about half of our entire sql table (~700k rows). After clicking the 'search' button, I was able to watch the memory usage on the diagnostics window steadily climb until it caused an out of memory error.

You can open a diagnostics window on the vision client if the menu bar is not set to hidden, the default diagnostic window has a memory graph on the bottom right. you can watch that as you navigate around your client session and see if there is a screen that, when you open it, causes a large, steadily climbing usage. If not, then you can leave the default client screen open and see if the memory usage steadily climbs without completely recovering or settling in.

If it's the first one, then I would take a look at the bindings on that page to make sure you aren't pulling in a large dataset from a tag when you don't need to.

If it's the second one, then I would look at your client event scripts and your client tags to make sure there isn't something there that is always running.

If it's the third, look at the process flow that happens after the action is performed, you might find something in one of the scripts.

Other than that, if you can't seem to locate the source then you'll have to brute force check any queries that you have in the project.

If there are named queries, try testing them in the designer with expected values for any parameters they may have. Designer runs on similar memory limitations as vision client so you might get lucky and have it throw an out of memory error.

3 Likes

Thank you so much for your time