PNGs not loading, appears to be random

Hello -

I’ve run into a new issue and I’m not sure how to resolve it. When I load my Vision client, at random 2 or more of my screens will not be able to load the PNG image I have placed as a background. If I open the designer and save to force a client refresh, the images will then load. I work for an integrator so I’d like to resolve this so when we pass over the project the customer does not need to worry about it. I’ve attached a picture of the issue on launch and after a force refresh. Any and all help is appreciated!

Any errors in the logs in the client ( Ctrl + Shift + F7 to open the diagnostics if you’ve got the menubar hidden)?
How big are these images, filesize-wise?

Did you increase the default vision memory settings from 256mb?

1 Like

Hello, thank you both for your replies.

The logs do show a error with image loader:

Message: Unable to read resized image from disk cache.
Time: jue. oct. 14 12:48:44p. m.
Severity: WARN
Logger: ignition.ImageLoader
Stack Trace: javax.imageio.IIOException: Caught exception during read:
    at java.desktop/ Source)
    at java.desktop/ Source)
    at java.desktop/ Source)
    at com.inductiveautomation.ignition.client.images.ImageLoader$ImageInfo.getScaledImageImpl(
    at com.inductiveautomation.ignition.client.images.ImageLoader$ImageInfo$ScaledImageCacheLoader.load(
    at com.inductiveautomation.ignition.client.images.ImageLoader$ImageInfo$ScaledImageCacheLoader.load(
    at com.inductiveautomation.ignition.client.images.ImageLoader$ImageInfo.getScaledImage(
    at com.inductiveautomation.ignition.client.images.ImageLoader.loadImageMemCache(
    at com.inductiveautomation.ignition.client.images.ImageLoader.loadImage(
    at com.inductiveautomation.ignition.client.images.PathIcon$LoadImageTask.doInBackground(
    at com.inductiveautomation.ignition.client.images.PathIcon$LoadImageTask.doInBackground(
    at java.desktop/javax.swing.SwingWorker$ Source)
    at java.base/ Source)
    at java.desktop/ Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
    at java.base/java.util.concurrent.ThreadPoolExecutor$ Source)
    at java.base/ Source)
Caused by: java.lang.OutOfMemoryError: Java heap space

Each image for each screen is between 2 and 3MB.

I have just tried raising the min and max memory settings from default and it does not appear to have made a difference.

EDIT: Also the “Home” screen is a screen with a scaled down copy of each full screen that the user can use to navigate to the area they want to monitor, so it includes all images and has never failed to load unlike the screens with a single image.

EDIT 2: It appears that instead of being “random”, it is always the last 2 or 3 screens that I try to open will fail to load the image.

For a test, what if you set the ‘Cache Policy’ of each window displaying one of these large images to Never? Then, once you navigate away, the window should be totally destroyed, freeing up that memory. The tradeoff is slightly worse performance each time you have to navigate to these windows (as slow as the initial open, that is).

They were 256mB, and you raised them to what?

I will try this test now.

Min was 32M and Max 265M, I stepped them up through Project Properties one at a time and relaunched the clients to test.

EDIT: Setting Cache to “Never” on each screen did not resolve the issue.

Can you give your clients more memory?
The code that’s failing is Java Swing code, not Ignition, and it’s failing for a fairly straightforward error - it was unable to allocate sufficient memory for the operation it wanted to perform.
Unfortunately, as a fairly old technology, Java Swing has a lot of limitations/design decisions that were made at a totally different time. For instance, basically all graphics operations in Swing happen on the CPU, with no hardware acceleration.

It is possible that there’s something we could do here to make things behave better, but anything we did wouldn’t help you in the short term. In the short term, you could try increasing the max memory further, or re-encoding these images in a different format (I would recommend trying .jpg); it’s possible simply reducing the image filesize will help with the memory issue.