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

    pfsense 2.5.2 slowly leaking memory

    Scheduled Pinned Locked Moved General pfSense Questions
    44 Posts 11 Posters 7.6k Views
    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.
    • N
      netnerdy
      last edited by

      version 2.5.2 had a major memleak because of the pcscd service. I have applied the fix for this, yet there is still something slowly leaking. you can see it in my memory chart:

      Is someone looking into this?

      937b6a15-7091-4513-93fb-8ae0e0ab23b6-image.png

      Cool_CoronaC 3 Replies Last reply Reply Quote 0
      • Cool_CoronaC
        Cool_Corona @netnerdy
        last edited by

        This post is deleted!
        1 Reply Last reply Reply Quote 0
        • Cool_CoronaC
          Cool_Corona @netnerdy
          last edited by

          This post is deleted!
          1 Reply Last reply Reply Quote 0
          • Cool_CoronaC
            Cool_Corona @netnerdy
            last edited by Cool_Corona

            @netnerdy

            95203fd5-60a8-4bda-a219-21afc90fb501-billede.png

            i dont see anything like that.

            mr.roshM 1 Reply Last reply Reply Quote 0
            • mr.roshM
              mr.rosh @Cool_Corona
              last edited by

              @netnerdy
              dats what I see. So what's your system RAM?

              b1d8c661-fee0-47a2-8b46-6f4ed2db97fe-image.png @cool_corona

              1 Reply Last reply Reply Quote 0
              • N
                netnerdy
                last edited by

                I have two gigs of ram. What do you guys see when you do a monthly view with 1 hour resolution?

                johnpozJ 1 Reply Last reply Reply Quote 0
                • P
                  psp
                  last edited by

                  Here is mine:

                  2021-09-01_103730.png

                  mr.roshM 1 Reply Last reply Reply Quote 0
                  • mr.roshM
                    mr.rosh @psp
                    last edited by

                    09f212ff-eadd-42c3-839a-1276dafe3a54-image.png @psp

                    GertjanG 1 Reply Last reply Reply Quote 0
                    • GertjanG
                      Gertjan @mr.rosh
                      last edited by

                      @mr-rosh

                      72182ade-cc97-48f0-978d-e10e23c14cd4-image.png

                      Stats for one month.
                      At the begin of the month pfBlockerNG was on holiday ...
                      The "pcscd " was applied more then a month ago.

                      @netnerdy said in pfsense 2.5.2 slowly leaking memory:

                      still something ...

                      Tell us what you have that we don't, and you'll know what that "something" is.

                      No "help me" PM's please. Use the forum, the community will thank you.
                      Edit : and where are the logs ??

                      mr.roshM 1 Reply Last reply Reply Quote 0
                      • mr.roshM
                        mr.rosh @Gertjan
                        last edited by

                        @gertjan
                        My deployment is a month old.. so it'll be not conslusive.

                        However, i'm on

                        Version 2.5.2-RELEASE (amd64)
                        built on Fri Jul 02 15:33:00 EDT 2021
                        FreeBSD 12.2-STABLE

                        Services are as below;
                        2b98c2e0-0276-461b-9a1e-baef8081f5bc-image.png

                        GertjanG 1 Reply Last reply Reply Quote 0
                        • GertjanG
                          Gertjan @mr.rosh
                          last edited by

                          @mr-rosh said in pfsense 2.5.2 slowly leaking memory:

                          However, i'm on
                          Version 2.5.2-RELEASE (amd64)

                          We all are.
                          ( if @netnerdy was mentioning another version, that answer would be "upgrade" )

                          Read "pcscd PC/SC Smart Card Daemon" to get rid :

                          e3fdf05a-59a3-4823-a111-4bd6c5eacb8a-image.png

                          so it won't auto start if your pfSense reboots.

                          No "help me" PM's please. Use the forum, the community will thank you.
                          Edit : and where are the logs ??

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

                            Yes, the pcscd process is the most likely suspect. Start by disabling it:
                            https://redmine.pfsense.org/issues/11933#note-7

                            Steve

                            1 Reply Last reply Reply Quote 0
                            • N
                              netnerdy
                              last edited by

                              I think explaining the graph I posted in the beginning will help.

                              The big mountains you see there are from the time when I didn't have pcscd fix. I would reboot pfsense and pcscd would eventually eat away my free memory. Like I mentioned in my first post, I have the full pcscd fix, so it doesn't start on boot anymore. You can see the positive effect it had on memory. I haven't rebooted pfsense for 7 days now. But it seems something else is chipping away at the memory.

                              @psp you most likely have a mem leak problem as well. Not sure if it's same root cause.

                              My services are below.

                              f82b8428-905b-4fcf-a80e-cde35b5cd8ca-image.png

                              I wonder if it's haproxy or vmware guest services. Perhaps it's wpa_supplicant (i do att bypass).

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

                                Is it actually still growing steadily? Hard to say from that graph.

                                Doesn't look like it's wired memory so what's using it? Check ps -auxwwd.

                                Also if it never actually exhausts it that may not be a problem. Unused RAM helps nothing.

                                Steve

                                N 1 Reply Last reply Reply Quote 0
                                • N
                                  netnerdy @stephenw10
                                  last edited by

                                  @stephenw10

                                  I would have expected a better response from Netgate: "If it never exhausts it that may not be a problem" is a frankly irresponsible way to categorize memory issues for a company that sells hardware that is supposed to run on devices with limited cpu and memory 24/7. Perhaps this kind of attitude allowed to slip a terrible memory leak like pcscd into production.

                                  Also what is the expectation here? Am I supposed to wait until all my memory is exhausted so my router goes down and suffer the consequences? I would rather be proactive than to be reactive.

                                  Sorry if this sounds too harsh, but please take this as constructive criticism as I really am not trying to troll you or Netgate.

                                  M stephenw10S 2 Replies Last reply Reply Quote 0
                                  • M
                                    mer @netnerdy
                                    last edited by

                                    @netnerdy
                                    I'm just a user of Netgate products but since the dawn of embedded devices there have been arguments around unused RAM.
                                    One school is RAM should be 100% used the other is basically "you should always have 20% free RAM just in case".

                                    If you have unused RAM you are not near capacity.
                                    Is this device using ZFS or standard UFS? That makes a difference.

                                    One also needs to understand the different types of memory: wired is basically kernel owned can't really be freed quickly. Cache and Free are self explanatory, Inactive is typically "was used but isn't now and should be freed next".

                                    The position "if it never exhausts it may not be a problem" is technically accurate. Think garbage collection or lazy releasing of memory; so "it's allocated right now but in secs it's freed".

                                    1 Reply Last reply Reply Quote 0
                                    • Cool_CoronaC
                                      Cool_Corona
                                      last edited by

                                      82365ff8-71a2-431a-b412-17ecf683bf68-billede.png

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

                                        @netnerdy said in pfsense 2.5.2 slowly leaking memory:

                                        Also what is the expectation here? Am I supposed to wait until all my memory is exhausted so my router goes down and suffer the consequences? I would rather be proactive than to be reactive.

                                        I'm asking if it's actually a leak or just something using memory because your graph in the first screenshot looks to be leveling off at ~30% which generally wouldn't worry me.
                                        The actual used memory value will vary wildly with how much RAM you have installed and what packages you're running. 30% of 64GB with no packages would be unexpected. 😉

                                        If it is a linear usage rise that characterises a memory leak then that's obviously a problem.
                                        In which case check what is using the memory.

                                        Steve

                                        N 1 Reply Last reply Reply Quote 0
                                        • N
                                          netnerdy @stephenw10
                                          last edited by

                                          @stephenw10

                                          Sorry if misunderstood, thx for the clarification. Unfortunately, I had to reboot my router for another reason so I'll need to wait a week to answer your question.

                                          I started paying attention to mem usage just because of the pcscd leak. When I saw the second drop I was worried. I would be totally content with the explanation of "this kind of mem usage trend is by design", which seems to be case. I'll revive this if I see anything fishy. thx!

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

                                            Mmm, hard to say without more data. If is is still leaking somewhere it's small. It could also be something that simply doesn't free memory unless it has to and since you still have >30% free it doesn't.
                                            Keep monitoring it. Check the process list.

                                            Steve

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