Netgate Discussion Forum
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Search
    • Register
    • Login

    PfSense uses 100% of swap but only 10% of memory.

    General pfSense Questions
    3
    7
    1.2k
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • M
      ma0f97
      last edited by

      Hey guys,

      I don’t really know why, but according to htop my PfSense uses 1024 MB / 1024 MB SWAP but only an average of about 878 MB / 10.9 GB of RAM (see attached picture).
      I set the RAM that high because the Web-GUI tells me, even with 11GB RAM configured, I am still getting to 93-99% Memory usage, but htop seems to disagree (?).
      The problem is that the interfaces for Suricata are constantly crashing and also the DNS Resolver seems unstable to me (sometimes takes ages to resolve a domain when connected to the FW, while https://1.1.1.1 loads instantly).

      Does someone know how to fix this problem? And who is „right“: PfSense Web GUI or htop?

      4B4768B5-E9B3-4DBE-B1A6-43DBEE87A796.jpeg

      96AA1AE7-14D6-4BB2-8C69-1EC712FDA1FE.jpeg

      TL;DR: PfSense tells me memory is nearly full and SWAP usage zero, while htop tells me the opposite.

      V 1 Reply Last reply Reply Quote 0
      • V
        viragomann @ma0f97
        last edited by

        @ma0f97
        Check out with top, what's eating up the whole memory.

        1 Reply Last reply Reply Quote 0
        • stephenw10S
          stephenw10 Netgate Administrator
          last edited by

          htop looks likes it's displaying an inverted value there because the dashboard shows 98% RAM used and 0% SWAP which is a far more feasible combination.

          Steve

          M 1 Reply Last reply Reply Quote 0
          • M
            ma0f97 @stephenw10
            last edited by

            @stephenw10 How could it display the opposite value? Isn‘t that strange?

            @viragomann

            top‘s output looks strange, maybe I interpret it wrong but why does it say 359M Active and 934M free? I have 11 Gigs RAM configured, what’s going on here? Is the RAM not recognized? I am really confused to be honest…

            E60CFEE1-681D-4591-A9B2-520522250735.jpeg

            V stephenw10S 2 Replies Last reply Reply Quote 0
            • V
              viragomann @ma0f97
              last edited by

              @ma0f97
              Order the output by memory usage:

              top -o res
              
              1 Reply Last reply Reply Quote 0
              • stephenw10S
                stephenw10 Netgate Administrator @ma0f97
                last edited by

                @ma0f97 said in PfSense uses 100% of swap but only 10% of memory.:

                How could it display the opposite value? Isn‘t that strange?

                It is strange, yes. I was assuming those were taken at approximately the same time. If they were not it's possible something used all the RAM and most of the swap and then freed the RAM when it was done.

                1G SWAP on top of 10G RAM doesn't make much sense there to me beyond providing somewhere to dump the crash reports.

                Also, generally speaking, if you start using SWAP at all you are usually doing something wrong.

                Steve

                1 Reply Last reply Reply Quote 0
                • M
                  ma0f97
                  last edited by

                  Ok I managed to solve the issue. The problem was that in the VM Hypervisor (Proxmox) I accidentally enabled „ballooning“ memory (which means it will remove memory on the fly if it detects that the VM is not using it).
                  I disabled it and now it all works like a charm. I guess the GUI (and myself) was confused that the RAM was removed from the VM while running, therefore showing memory usage „of 11GB“ while in reality it only had way less memory at this point.

                  1 Reply Last reply Reply Quote 1
                  • First post
                    Last post
                  Copyright 2025 Rubicon Communications LLC (Netgate). All rights reserved.