Jump to content
Neil Pate

Linux cRIO Memory Usage

Recommended Posts

As per this KB it is no longer possible to retrieve the memory usage using the System Session property nodes. Considering the Linux implementation is several years old already this seems like quite an oversight but not something NI seems terribly worried about. The solution proposed in the KB seems quite incomplete.

Strangely, NI do have a way to get this info as it is reported in MAX

image.png.2cdd012bbb98a8d10b041b99a83c16f3.png

 

Does anyone have a solution for this?

 

Share this post


Link to post
Share on other sites

spitballing, having never worked on cRIO: standard linux ways like just parsing the output of free wouldn't help? Or reading /proc/meminfo?

Share this post


Link to post
Share on other sites
29 minutes ago, ensegre said:

spitballing, having never worked on cRIO: standard linux ways like just parsing the output of free wouldn't help? Or reading /proc/meminfo?

Yeah it seems this is the way to go, I was just hoping somebody had done this already 🙄

I have tested both using an SSH console into a cRIO VM and they do seem to work.

image.png.315cc0794ab19120de00dba3cfac3094.png

Edited by Neil Pate

Share this post


Link to post
Share on other sites

I would suggest the "/proc/meminfo" because you can read it as if it was a text file with the LabVIEW file functions.

  • Like 1

Share this post


Link to post
Share on other sites

Permissions might prevent the reading of the file.  If you do a Open File maybe even set to read only then read the file you might have better luck.  Also calling a system exec and reading the standard output might work as well.

Share this post


Link to post
Share on other sites
1 hour ago, Neil Pate said:

The confusing thing is the file read does work, but only if I read it as lines instead of characters. 

I don't have a linux machine handy, right now, but try unchecking the "Convert EOL".

Share this post


Link to post
Share on other sites
2 hours ago, ShaunR said:

I don't have a linux machine handy, right now, but try unchecking the "Convert EOL".

Tried that, no dice. The file read returns an empty string.

Share this post


Link to post
Share on other sites
1 hour ago, Neil Pate said:

Tried that, no dice. The file read returns an empty string.

FWIW I just checked on a 9046 and same behavior as Neil.

Share this post


Link to post
Share on other sites
On 1/21/2020 at 5:53 PM, Neil Pate said:

Tried that, no dice. The file read returns an empty string.

OK. Got hold of my Linux Box with LabVIEW. Wire a number of bytes to the "Count" (1024?). Ignore the error 4 if you demand too many.

  • Like 2

Share this post


Link to post
Share on other sites
2 hours ago, ShaunR said:

OK. Got hold of my Linux Box with LabVIEW. Wire a number of bytes to the "Count" (1024?). Ignore the error 4 if you demand too many.

Oh yeah, just wire a -1 and you get the whole file.  I always forget that.

Share this post


Link to post
Share on other sites
12 hours ago, hooovahh said:

Oh yeah, just wire a -1 and you get the whole file.  I always forget that.

Tried that in my original test, still did not work.

Edited by Neil Pate

Share this post


Link to post
Share on other sites
13 hours ago, hooovahh said:

Oh yeah, just wire a -1 and you get the whole file.  I always forget that.

That doesn't work. I would say it is a bug but it's never worked. ¯\_(ツ)_/¯.

1 hour ago, Neil Pate said:

Tried that in my original test, still did not work.

This is what I have on my Linux box (not a cRIO though) so if you don't get anything; that is definitely a bug.

image.png.e40727a45e05da28857b00425ae35b96.png

 

 

Share this post


Link to post
Share on other sites

Okay I'm done guessing without actual testing in the environment.  In Windows -1 on the Read From Text File, and Read From Binary File both read the whole file.  I feel like there is a bug or two found in this thread.

Share this post


Link to post
Share on other sites

Given that it's not an actual file perhaps it has no idea of how much to read without parsing the lines in the primitive? There is no "size" information but if it reads as lines it keeps going until the end using read operations. Regardless -1 does not work on my 9046.

Share this post


Link to post
Share on other sites
2 hours ago, hooovahh said:

Okay I'm done guessing without actual testing in the environment.  In Windows -1 on the Read From Text File, and Read From Binary File both read the whole file.  I feel like there is a bug or two found in this thread.

If you read a text file then it will work. However. as Jordan states; it is not an actual file. It's is a text output stream from the VFS.

  • Like 1

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.