Problem with PxLoadImage

I have an application with approx 160 PNG image. PxLoadImage is used to load them.

Normal program operation loads them as needed and caches the loaded images. After 60 or 70 images have been loaded and cached, PxLoadImage returns a NULL and the program quits.

As an experiment, I modified program startup to load all the images. This succeeds, but much time is spent loading the images - which is undesirable. FWIW, approx 16MB is allocated for px_alloc. The failures tend to occur after 9 to 10MB have been allocated.

PxLoadImage doesn’t provide any useful information about what’s wrong. The px_error message is simply “Can’t load image”.

Any suggestions on how to learn what’s really wrong?

Is source code available for PxLoadImage that would let me learn more?

Regards,

David

For starters, load slowly and check “pidin mem” to see if anything obvious is happening.

I assume that you have checked the obvious like how much memory is in the system and how much room the expanded png’s will take up. For example, a 100 x 100 PNG could take 40K+ bytes.

Also, are you loading into shared memory? “ls /dev/shmem”. I’m not sure about how QNX handles this. It might be possible that you are using up LDT table entries. There might be a PROC parameter that allows expanding this.