Memory leak(s), GALORE

Please post your problem description here

Moderator: Barb@Invincea

Curt@invincea
Sandboxie Lead Developer
Sandboxie Lead Developer
Posts: 1664
Joined: Fri Jan 17, 2014 5:21 pm
Contact:

Re: Memory leak(s), GALORE

Post by Curt@invincea » Fri Sep 12, 2014 1:08 pm

This leak is fixed in 4.13.4.

DR_LaRRY_PEpPeR
Posts: 291
Joined: Wed Jul 04, 2012 6:40 pm
Location: St. Louis area

Re: Memory leak(s), GALORE

Post by DR_LaRRY_PEpPeR » Fri Sep 12, 2014 1:30 pm

Really?! :shock: Awesome! :D (Little later and I wouldn't have seen till tonight...)

Can you tell us any more about the leak? (More than just SetWindowPos, etc.?) Did my sample program make it easier to track down? (I assume you're talking about the memory.)

What about the Port handles increasing? I don't know what triggers that at all, so I can't provide any more info; just know it's pretty consistent each day...


I was gonna ask, "So when does 4.13.4 come out?!?!?!" :P ;) But just checked and see the combined installer is already online with a modified time of last night -- so it's ready to go but not announced yet? I'll try it out shortly! 8)
XP Home-as-Pro SP3 (Admin) w/ continued updates (Embedded/POSReady 2009)
> Permissions + "2-level" SRP, latest Sandboxie (Pro/registered), EMET 4, no anti-anything (ever)
Did I make tzuk crazed... in his last days? :o

Curt@invincea
Sandboxie Lead Developer
Sandboxie Lead Developer
Posts: 1664
Joined: Fri Jan 17, 2014 5:21 pm
Contact:

Re: Memory leak(s), GALORE

Post by Curt@invincea » Fri Sep 12, 2014 1:52 pm

Your Sbie_SWP app showed the problem magnificently :D . SbieSvc.exe was leaking a Critical Section object (HANDLE) every time it hit its memory pool. In this case on every call to SetWindowPos, but the memory pool is accessed by many things, so this will fix a lot of leaks. I also found a Device Context (DC) leak in SbieCtrl.exe when moving around in the sandbox settings tree.

I don't see anything with port handles specifically, so let me know if you can repeat this. The difficulty in finding these handle/memory leaks is that there can be thousands of false positives to sort through with a leak detector app. So any way to make them stand out with a stress test is helpful.

4.14.4 is on the web site, but I need to make 1 tiny change in the installer. But, you can go ahead and get a head start. I'm working up the change log, and will post it later today, so everyone can have weekend fun testing the Sandboxie Beta :wink:

DR_LaRRY_PEpPeR
Posts: 291
Joined: Wed Jul 04, 2012 6:40 pm
Location: St. Louis area

Re: Memory leak(s), GALORE

Post by DR_LaRRY_PEpPeR » Mon Sep 15, 2014 11:16 am

Cool, that was great to hear. :D Hmm, a Critical Section HANDLE -- I never saw Handle count increasing (other than the Port ones)... But maybe that's another one of those kernel resource-type objects that doesn't show as a "regular" Handle (like Crypto's reg. notification stuff). Anyway, thanks for the info!


And after almost 3 days running now, I'm very pleased to report that GuiProxy's memory usage has finally remained low and steady!! :mrgreen: 8) It stays even lower than the "main" SbieSvc process (which has always remained low). Checked of course with my Sbie_SWP test and also re-running my original ToolTipFixer loop. All fine (although as I said, I haven't seen a need for TTF so far since I stopped it to save memory).


There are also only a few hundred "Strings" in Memory (in Process Hacker), just like when it started, instead of increasing by thousands/day (I'm guessing) like before. Some of them still look like partial "garbage" and Clipboard fragments (privacy?!)... Unless that has been freed and Process Hacker is still identifying "strings" that may ultimately be overwritten. (I wouldn't think so though; unless you're using your own memory manager where the segments aren't technically "free" to Windows.)


Don't know what else to say about the [ALPC] Ports, but it seems to "repeat" on its own continuously. As I said before:
DR_LaRRY_PEpPeR wrote:Regarding the the Port leak: I see they're called ALPC Ports on Win 7 (64) (in ProcExp and Hacker)... And in Win 7 64 (just Media Center running), Sandboxie is totally idle with just an empty IE 8 window open. 800 ALPC Ports leaked after sitting for just 48 hours! (I knew handles were increasing there for no reason, just hadn't checked the numbers.)
Average over 200/day on XP instead of 400. I think the other XP system was left idle with just Firefox sandboxed, and they were increasing a few per hour. So I don't think it needs IE -- although that's a safe bet (6 on XP, 8 on 7).

If you can see that, I'd think you'd know which functions/stuff can create/return [ALPC] Ports, and find where they're not being Closed/released... :?: :|

And like I said before, the Ports stopped increasing when GuiProxy's memory was exhausted during my test :P :lol:, although surprisingly everything still seemed to work! :shock:

Post Reply

Who is online

Users browsing this forum: No registered users and 32 guests