Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Potential Memory Leak #151

Closed
LtMama opened this issue Mar 9, 2017 · 7 comments
Closed

Potential Memory Leak #151

LtMama opened this issue Mar 9, 2017 · 7 comments
Assignees
Labels

Comments

@LtMama
Copy link

LtMama commented Mar 9, 2017

I recently noticed a proportional trend between Santa app and santad's memory usage and a mac's uptime.
I've looked at multiple macs in our fleet (running 10.10/10.11/10.12) and it appears to be consistent with throughout.

We're running Santa pretty lightweight, Default configuration with 4 blacklisted binaries (OS X Installers)

Example of the uptime/usage trend:

Uptime Total Santa Memory usage
1 hour 7.7 MB
7 days 230 MB
15 days ~520MB
42 days ~890MB
55 days ~1200MB

screen shot 2017-03-09 at 17 09 24

Let me know if there's anything else I can provide to help

@russellhancox
Copy link
Collaborator

Can you confirm you're running the latest version (0.9.16)? We're trying to reproduce but none of our machines seem to have unexpectedly high memory use.

We think it could be due to fast-user-switching which we don't really use but Santa is designed to support. A recent commit (5e4b835), which hasn't yet been included in a release could have inadvertently fixed this but we'd like to reproduce to confirm.

@tburgin
Copy link
Member

tburgin commented Mar 9, 2017

Could you also provide your config?

cat /var/db/santa/config.plist

@LtMama
Copy link
Author

LtMama commented Mar 10, 2017

@russellhancox
Turns out majority of users were still running 0.9.14 (we packaged 0.9.16 back in Feb, but didn't actually push it out to everyone face palm Pushed out now).

Having said that, the first 3 entries in that table were running 0.9.16, so although it's a smaller sample size, might still be the case. Also found another one running 0.9.16, uptime 28days, Santa using 1.8GB.

@tburgin
Hmmm, there doesn't appear to be a santa config.plist on any mac that I've checked

/var/db/santa
-rw------- 1 root wheel 5169152 9 Mar 19:19 events.db
-rw------- 1 root wheel 12288 10 Mar 09:51 rules.db
-rw------- 1 root wheel 12824 10 Mar 09:51 rules.db-journal

Currently, we've just left Santa in the default MONITOR mode, and been adding items to the blacklist by sending a payload-free package containing 4 santactl commands

@tburgin
Copy link
Member

tburgin commented Mar 10, 2017

Thanks, I am still unable to reproduce the issue. When you come across a machine that is in this state can you grab a memory graph and share it here?

sudo leaks santad -outputGraph ~/Desktop/santad.memgraph
sudo leaks Santa -outputGraph ~/Desktop/Santa.memgraph

@LtMama
Copy link
Author

LtMama commented Mar 10, 2017

Sure thing. Got ones from the mac that was sitting on >1.8GB, but the files are about 30MB each, so Github's saying no. Want me to send them to you directly?

screen shot 2017-03-10 at 17 46 40

@tburgin
Copy link
Member

tburgin commented Mar 10, 2017

Yeah, that would be great.
tom.burgin@mac.com

@tburgin
Copy link
Member

tburgin commented Mar 17, 2017

It turns out when running without a config both binaries will leak around 24 bytes every 200ms.
This seems consistent with your real world findings.

24 bytes * 5 times per sec * 60 min * 60 hour * 24 day * 100 days
1.0368 gigabytes 

Fixed in #154

@tburgin tburgin closed this as completed Mar 17, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants