Something seems to be not quite right with rctl(8) .
According to the klarasystems blog, I can limit the amount of RAM a jail(8) uses:
Based on that, I thought I could limit the amount of RAM a jail with Firefox uses. I followed the wiki: https://wiki.freebsd.org/JailingGUIApplications . I had to modify the procedure to get Firefox working.
My idea was, on a laptop with 8 GB of RAM, I could limit a jail with Firefox to using just 4 GB of RAM. But this idea is just not working:
Firefox starts fine. BUT from get-go, it grabs more than 1.6 GB of RAM, before I navigate anywhere.
Going to Discord and logging in: That grabs over a GB of RAM, and vmemory use is through the roof.
Opening up tenor.com in a separate tab: (Yeah, not a very good representation, because I did visit it earlier, also opened it up in a separate tab, and had KDE freeze up on me. An attempt to repeat the procedure for taking down notes on how that step affects me - that goes way smoother than last time!) Grab 814 MB more of RAM.
Opening espn.com in a new tab: That makes the whole system freeze up, I'm unable to move the mouse, or SSH in. Only a hard reboot gets me unstuck. And one more thing: Before I even had the idea to take these notes, I've seen
Hopefully a dev sees this, and maybe can give some suggestions: If there's a bug to be filed, I'd appreciate a link... There's always a possibility that I didn't understand something about the design of jail(8) or rctl(8) and used some incompatible options - if there's a good way to explain that, I'd love to learn that.
Or is firefox just pushing the technical limits of what a jail can do? I've seen info that a dev gave up trying to port ff's memory management to FreeBSD. I wish I discovered this earlier when I was making a wishlist for the FreeBSD Foundation... oh well.
Edit: Had to delete a bit of accidentally duplicated text from this post.
According to the klarasystems blog, I can limit the amount of RAM a jail(8) uses:
Based on that, I thought I could limit the amount of RAM a jail with Firefox uses. I followed the wiki: https://wiki.freebsd.org/JailingGUIApplications . I had to modify the procedure to get Firefox working.
My idea was, on a laptop with 8 GB of RAM, I could limit a jail with Firefox to using just 4 GB of RAM. But this idea is just not working:
Code:
# rctl -h
jail:firefox:memoryuse:deny=4096M
# xhost +
access control disabled, clients can connect from any host
# jail -c firefox
Code:
# rctl -uh jail:firefox | grep memory
memoryuse=1654M
memorylocked=0
vmemoryuse=16G
Code:
# rctl -uh jail:firefox | grep memory
memoryuse=2745M
memorylocked=0
vmemoryuse=35G
Code:
# rctl -uh jail:firefox | grep memory
memoryuse=3559M
memorylocked=0
vmemoryuse=30G
memoryuse=4286M
! I thought I limited it to 4096 MB???Hopefully a dev sees this, and maybe can give some suggestions: If there's a bug to be filed, I'd appreciate a link... There's always a possibility that I didn't understand something about the design of jail(8) or rctl(8) and used some incompatible options - if there's a good way to explain that, I'd love to learn that.
Or is firefox just pushing the technical limits of what a jail can do? I've seen info that a dev gave up trying to port ff's memory management to FreeBSD. I wish I discovered this earlier when I was making a wishlist for the FreeBSD Foundation... oh well.
Edit: Had to delete a bit of accidentally duplicated text from this post.