ossimlabs/ossim

Too many files open

ghansham opened this issue · 11 comments

We have a frame camera that covers a large area on earth by stitching frames. We found that elev classes keeps opening files and at times it crosses the system limit of 1024. Do we have a way to restrict the number of files opened by ossim Elevation classes. We are sure because we checked using lsof for the running process. We are running on rhel 7.X.

Thanks. I will try the suggested solution.

This worked. Actually issue was coming because ossim elevation manager threads were enabled. By default it was using 32 threads. Another observation is that same file was opened by multiple ossim elevation database instances. Is that fine?
Another suggestion was while loading the default paths for elevation, it should check existence of those paths before instantiating the relevant classes.

In the loadStandardElevationPaths method in ElevManager class, the loadElevationPath method is called for userPath and installPath without checking for their existence. It checks for existence after calling open on the path. That open is even is also not required. See line number 214 in loadElevationPath. The path existence should be checked within loadStandardElevationPaths. That may do away with with open function call which is not required if path does not exist.

Regarding sharing of elevation managers, if the cells are mapped to memory, they can be shared, that can reduce the memory foot print. Am I correct?

I think loadElevationPath should have existence check before calling open because this method might be getting called from multiple places other than loadStandardElevationPaths.

Regards
Ghansham

Ok. I agree. Yeah its only during initialization. Idea too was to speed up the startup time only.