[SDL] PNG file loading limit problem

Tomas Carnecky tom at dbservice.com
Wed Feb 21 04:12:54 PST 2007


clemens kirchgatterer wrote:
> On 2/21/07, David Allen <allend03 at optusnet.com.au> wrote:
>> I have a project which uses SDL_image/libPNG to load 1063 png files. This
>> works ok under windows but fails under linux. I know I have enough memory to
>> load all the png files and that all the images display ok on windows and
>> linux. Linux will load only 1016 files. When trying to load png # 1017 it
>> reports that the file type is unknown. If I reduce the size of the files it
 >
> sounds like a file descriptor limit. maybe your program or SDL_image
> leaks the filedescriptors?
> 

$ ulimit -a

and more specifically

$ ulimit -n

will show you how many files you can have open at a time. I have three 
linux systems, two show 1024, one 4096. 1024 seems to be default, though 
it's configurable, but you have to have the appropriate permissions 
(root). I have no idea how to set the limit globally at startup other 
than editing the kernel headers and recompiling the kernel.

tom


More information about the SDL mailing list