View topic - Problem with PxLoadImage

Problem with PxLoadImage

Discussion about the QNX6 OS.

Problem with PxLoadImage

Postby relson » Sun Jan 20, 2013 4:48 pm

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?


Active Member
Posts: 10
Joined: Fri Nov 02, 2012 5:35 pm

Re: Problem with PxLoadImage

Postby maschoen » Sun Jan 20, 2013 6:30 pm

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.
QNX Master
Posts: 2728
Joined: Wed Jun 25, 2003 5:18 pm

Return to QNX6 - OS

Who is online

Users browsing this forum: No registered users and 2 guests