showmem execution failed after 2-3 successful executions

While doing some test I observed that showmem execution failed.
I am working on QNX 6.5
My query is - what can be probable reason of failure of showmem?
Two cases are there

  1. showmem not able to access shared library
  2. showmem failed with error - Filename too long

As per the source code of showmem the second error could be because of fopen call to FILE *f = fopen(“memory.use”, “rb”);

Result of showmem -

showmem -S

System RAM: 1023M ( 1073737728)
Total Used: 308M ( 323822532)
Used Private: 228M ( 239284892)
Used Shared: 68M ( 72155136)
Other: 11M ( 12382504) (includes IFS and reserved RAM)

showmem -P | grep -i xyz

1351680 548864 270336 376832 155648 0 577617 xyz

showmem -S

sh: showmem: Can’t access shared library

showmem -P | grep -i xyz

sh: grep: Can’t access shared library
sh: showmem: Can’t access shared library

showmem -S

sh: showmem: cannot execute - Filename too long

showmem -P | grep -i xyz

sh: can’t create pipe - try again

showmem -S

sh: showmem: cannot execute - Filename too long

Regards,
QNXuser1

Both failures could be due to system out of fd’s. Before failure, try running “pidin fd | wc -l” to observe the count of fd’s in use. If it is going up, you are leaking file descriptors until system can no long load programs.

fd limit per process is 1000.
I checked the fd count per process and the count is less than 100 (per process)