LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

What is the limit on the number of open files in a cRIO?

Solved!
Go to solution

What is the limit on the number of open files on a cRIO? There was a question that came up as to how many files could be opened and not closed by the Close File VI. I know that failing to close a file when the reference is no longer needed is a memory leak that will eventually cause the cRIO to stop execution of the code, but is there a limit to the number of open files?

0 Kudos
Message 1 of 6
(1,260 Views)

@David_Fanelli wrote:

What is the limit on the number of open files on a cRIO? There was a question that came up as to how many files could be opened and not closed by the Close File VI. I know that failing to close a file when the reference is no longer needed is a memory leak that will eventually cause the cRIO to stop execution of the code, but is there a limit to the number of open files?


I would ask whoever had that question the better question: "Why do you need to know?"  I feel like any architecture where you will have to worry about exceeding the number of open files allowed in an OS might need to be re-thought.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
0 Kudos
Message 2 of 6
(1,231 Views)

I asked out of curiosity more than anything else. My hypothetical case was where a logger resident in a cRIO failed to close the log file in use before opening a new one using the same file reference. Would the resulting memory leak case resource starvation and system shutdown, or would the limiting factor be number of open files?

0 Kudos
Message 3 of 6
(1,224 Views)

@David_Fanelli wrote:

I asked out of curiosity more than anything else. My hypothetical case was where a logger resident in a cRIO failed to close the log file in use before opening a new one using the same file reference. Would the resulting memory leak case resource starvation and system shutdown, or would the limiting factor be number of open files?


Hmmm, interesting thought experiment.  I don't really know the answer to that, and if anyone actually know, please feel free to let us know!  As for the practical side of things, try make sure that the log file closes "no matter what".  I put it in quotes because you can't ever guarantee that it will close given unforeseen disaster, but you can get pretty close to that, so that almost the only case where it would stay open is a case where you would have to do a reboot - which i suppose is going to close that file anyway.

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 4 of 6
(1,215 Views)
Solution
Accepted by topic author David_Fanelli

As NI Linux RT is simply a Linux system for pretty much anything that you may be concerned about, that is 1024 per process and something like 70000 in total.

 

The max number per process can be changed by an admin with ulimit -n and the max number of total file handles is in /proc/sys/fs/file-max.

Rolf Kalbermatter
My Blog
Message 5 of 6
(1,208 Views)

@rolfk wrote:

Normally that is 1024 per process and something like 70000 in total.

 

The max number per process can be changed by an admin with ulimit -n and the max number of total file handles is in /proc/sys/fs/file-max.


Nice.  I knew someone would know, and somehow I knew it would be you, rolfk.  🙂


Thanks!

Bill
CLD
(Mid-Level minion.)
My support system ensures that I don't look totally incompetent.
Proud to say that I've progressed beyond knowing just enough to be dangerous. I now know enough to know that I have no clue about anything at all.
Humble author of the CLAD Nugget.
Message 6 of 6
(1,203 Views)