Memory leak(s), GALORE

Please post your problem description here

Moderator: Barb@Invincea

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

Memory leak(s), GALORE

Post by DR_LaRRY_PEpPeR » Fri Feb 28, 2014 10:15 am

Will Invincea give this/these problem(s) any more attention? In my topic from 6-8 months ago, System-wide performance killed (and that still happens like clockwork every 19-20 days!), I mentioned the ever-increasing memory usage/leakage with the Sandboxie service GuiProxy process. AFAICT tzuk never looked at the "garbage dump" files I linked to... (Could also pose major privacy concerns as I said.)

But lets just talk about the consistent and constant memory loss ("usage"). Does everyone restart their computer every day (or every few hours?), or the Sandboxie service, and really never see this?

AFAICT, the memory is never, EVER touched again! If so, and it's not being freed, it's a leak, no? Constant and consistent, like I said. Just a bit over 20MB per day. In less than a day, mine will be at 750MB after installing 4.08 on Jan. 25th. :(

I'd call it horrendous, mostly because it looks bad (and sloppy) -- I haven't noticed that it directly affects anything (it can all be paged out since it's never referenced), at least not until it crashes at memory limit -- I've probably only gotten almost halfway there (??), since you know, I'm installing almost every version (on some system) to test and report anything, a lot of which I'm still waiting on for a year or more... :cry:


Shouldn't it be pretty easy for you to run it for any length of time (few hours) and find where the leaking allocations are coming from??
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

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 Apr 07, 2014 11:00 am

So this was Task Manager after running 4.08 for 6-hours-shy of 70 days: Processes / Performance Shockingly consistent rate of 20,000 KB per day!! :shock: Installed 4.09.02, opened couple programs, away a couple hours, and it already climbed noticeably. It's just over 40 MB now after 55 hours...

Will you please confirm: Leak? OR by-design and expected?! Or... help identify what's causing it "on my system?" :)

Only reason Mem Usage is down a bit (vs VM Size) is from when the system started running out of memory. Like I said, Mem Usage stat CAN be dropped completely by using "Reduce Working Set" in Process Hacker, for example. Then it will start climbing from there again; thus AFAIK, proving that the memory is never touched again after initial allocation/use.

I assume everyone else has the same behavior, unless confirmed otherwise? Is it only on XP? I haven't checked anything else.


Never an issue whatsoever with system otherwise, besides Sandboxie stuff, since boot/logon Nov 8th...

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 » Tue Apr 08, 2014 9:35 am

GOT IT! I stopped the leak quickly yesterday after restarting Sandboxie stuff (and it didn't take a revolutionary new product from Billy Mays, et al. :P).

After my off-hand comment yesterday about "GuiProxy and its GUI-proxying related-ish stuff," I was thinking how there's NO way our usage, doing whatever, is as consistent as the memory increase. So I thought about what windowing-related stuff could be happening so consistently even when idle. So just stopped a couple programs as a quick test.

Back later, 6-8 hours, didn't look like it changed too much (small continual creeping is prob normal, to some point). I added the one program back, which I didn't think was a problem... A few more hours it's 15 hours so obviously would have increased by over 10 MB usually...

It was still just 1,680 K total. :)

BUT, I couldn't reproduce the leak in the fresh Virtual Box install over those hours! So I went ahead and tried the other laptop system (fresh install still, as usual, haha). Nope! Then I was wondering if it was an interaction with that one program and my NVIDIA video driver or such. Not too likely, I thought.

Started thinking about what else I could add back to the fresh installs to trigger it. Ahh, bingo!

It's an interaction with two programs somehow (I think, unless that just magnifies it), and GuiProxy of course. Yep, XP-only, and very unlikely another Sandboxie user has this combo. :oops: Should be an easy repro and hopefully fix (maybe it happens otherwise and rarely "hit").

Those 2 new installs are leaking away for the last couple hours now. :lol:

Wow, wow, wow. Can't believe I never checked into this more. I shouldn't have taken time to post this now, got to go, but will be back later sometime with relevant specifics (simple). Any guesses which 2 programs from my process list are triggering this? :shock:

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 » Wed Apr 09, 2014 10:56 am

OK, the 2 initial programs I stopped were AutoSizer and 4t Tray Minimizer (I'm wanting to make my own Sandboxie-friendly replacement for both of these...). I started AutoSizer again, and confirmed that it was NOT related to the leak.

But like i said, after putting 4t Tray Minimizer on both other systems, the leak wasn't happening. :x The other things I wondered about were Speckie (changes windowing stuff in IE a bit) and Taskbar Shuffle (should just be Explorer-specific though). Irrelevant because I found the interaction after adding...

ToolTipFixer! Looks like it's not for XP only... But it keeps doing something regularly (every few seconds) that 4t Tray, and its DLL in sandbox, must be reacting to, and therefore triggering allocations in SbieSvc's GuiProxy that aren't being freed?

So, to reproduce: install ToolTipFixer (service) and 4t Tray Minimizer 5.52 (defaults...). Don't forget to enable Software Compatibility for 4t Tray.

Then just open [sandboxed] IE 6 and there's the leak. :) It seems to go faster (on an otherwise-empty system) opening a few windows, or also Outlook Express. Still slower than my main system -- maybe 12 MB/day rate.

Just one of those programs doesn't trigger it!

I wonder if there's a slow leak otherwise... I have 1 empty IE 8 open for 3 days on the Win 7 system (first time I've "used" Sandboxie for more than 5 mins!) and the GuiProxy memory has increased from 1, to over 3 MB.


Please check ASAP and let me/us know what you find. :o Thanks!

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 » Tue Apr 15, 2014 9:54 am

Did anyone try to reproduce this, Invincea or otherwise...? (BTW, you don't have to give an e-mail to download ToolTipFixer, just click Download.) And I'm trying to see if I guess I should still run TTF, I don't guess the problem ever got fixed somehow... Still a Sandboxie leak in any case. :)

I just thought of and tried something last night, which demonstrates the leak much more rapidly! Service running or not doesn't matter, just run it manually in a loop:

Code: Select all

@echo off

:loop
"%ProgramFiles%\NeoSmart Technologies\ToolTipFixer\ToolTipFixer.exe" -f > nul
goto loop
Ctrl+C to stop batch/cmd execution...

On my main system, this increases SbieSvc GuiProxy's memory by nearly 2 MB per minute! (So could crash within 20 hours instead of 3 months?) A lot less in bare VM, but you can "watch" it easily now with OE/IE windows sandboxed.

Again of course, that's with 4t Tray running (and in Software Compatibility); otherwise Sandboxie is fine.


So, easy to fix? For 4.10? :D

Peter2150
Posts: 879
Joined: Tue Mar 27, 2007 9:46 pm
Location: Washington DC

Re: Memory leak(s), GALORE

Post by Peter2150 » Wed Apr 16, 2014 8:09 am

If I understand right this leak depends on installing software and then letting the system run for days on end. I can't test this because everything is shutdown at night and usually rebooted during the day.

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 » Thu Jun 05, 2014 1:48 am

Yeah Pete, but not necessarily to reproduce this. :)

Just install ToolTipFixer and 4t Tray (configured with Sandboxie Compatibility) and run the above batch file that loops. The leak is still happening.

And even without both of them running, something is still going on. Rough guess, it might take a couple weeks to leak 20 MB (instead of each day I had with both).

Also, there SEEMS to be a HANDLE leak also in the GuiProxy process -- I think they were Port handles in Process Hacker (like a couple dozen per day increase), if you want to look into that.

Again, I'll probably be away, but thanks in advance! :)

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 » Tue Jun 17, 2014 4:05 pm

Dr., I have run the tests exactly as described. Memory levels for SbieSvc.exe are completely flat.

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 » Wed Jun 18, 2014 6:56 am

Including the GuiProxy SbieSvc.exe process I assume? Did you have IE 6 windows open (or OE too)...? I forgot to mention that part again in my quick last post!
DR_LaRRY_PEpPeR wrote:Then just open [sandboxed] IE 6 and there's the leak. :) It seems to go faster (on an otherwise-empty system) opening a few windows, or also Outlook Express.
DR_LaRRY_PEpPeR wrote:A lot less in bare VM, but you can "watch" it easily now with OE/IE windows sandboxed.
Otherwise maybe I can provide my fresh VM install? It's easily reproducible with each XP/IE 6 install/system here... And of course very observable using ToolTipFixer batch loop!


Otherwise, without having TTF running for a while, the memory usage (GuiProxy) still increases slowly like I said -- it's been a bit over 5 days with 4.12, and it's gained ~7-8 MB so far.

And yes, verified about the presumed GuiProxy HANDLE leak -- they are Port Type in Process Hacker (not sure what those are?). Over 600 so far (> 100/day), and it'll never decrease. Any idea about those? :?

nnezz
Posts: 48
Joined: Tue Jul 13, 2010 7:52 am

Re: Memory leak(s), GALORE

Post by nnezz » Wed Jul 23, 2014 4:35 pm

Considering DR_LaRRY_PEpPeR's accurate analysis in the other memory leak thread, it would behoove current developer to look into this matter further - instead of doing corporate denial with minimal testing. :roll:

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 » Thu Jul 24, 2014 11:26 am

nnezz wrote:Considering DR_LaRRY_PEpPeR's accurate analysis in the other memory leak thread, it would behoove current developer to look into this matter further - instead of doing corporate denial with minimal testing. :roll:
Thanks for the helpful suggestion. Although it is somewhat late. http://forums.sandboxie.com/phpBB3/view ... 48&t=19151

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 » Sat Aug 16, 2014 8:55 am

nnezz is right Curt. ;) This hasn't been fixed or improved at all. You're telling me you did what I asked about in last post and it's fine? TTF (looped to accelerate effect) + 4t Tray (w/ Compatibility) + sandboxed IE 6 (the more the better)?

GuiProxy's memory usage stays "completely flat" when I'm watching it run away?


Anyway, the only reason mine isn't still losing 20 MB/day is because I stopped the TTF service (and my taskbar tooltips have remained fine, hmm; they were a problem years ago...). It's still losing well over 1 MB/day though.

After 34.5 days it was in the mid-50 MB range.

And the Port handle leak, wow! There were 8,400 Port handles in GuiProxy after 34.5 days. 360 so far now after 2.5 days using 4.13.2.


Please, please fix these GuiProxy leaks too. :o
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

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 Aug 18, 2014 2:25 pm

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.)


And I think I pretty much narrowed down the GuiProxy memory leak (blindingly obvious and undeniable), or at least a part related to the bigger picture.

I knew that ToolTipFixer does EnumWindows...GetClassName...if (class=="tooltips_class32") SetWindowPos(... TOPMOST ...), etc. I did the same and verified. It still needed 4t Tray running to leak, like I've described.

But now, forget that! You can make GuiProxy leak memory pretty fast just by running code IN the sandbox! :D Nothing else needed. Verified on 3 XP installs (1 totally fresh/clean VirtualBox install) and 64-bit 7. Win 8 32-bit does NOT seem to be affected during my quick check with this PoC program.

The problem, or one of them, is using SetWindowPos on an UNsandboxed handle (my example program just grabs Explorer's Shell_TrayWnd). (No idea how 4t Tray relates to this when TTF is unsandboxed. :?: :?) Maybe there are some other Set* type functions that make GuiProxy leak when trying to go outside the sandbox??


So all you need to see for yourself is the program, Sbie_SWP. (Yes, it's only 2 KB.) (Source) Run it sandboxed. It literally doesn't DO anything, so it's safe. :) Nothing happens UNsandboxed no matter what, since it's like a "void" function call that only screws up Sandboxie when sandboxed. :o

That should make GuiProxy leak as fast as possible (at least on XP and 7). Close console window when done (it'll stop after a million iterations otherwise).

Please check it out and let us know what's going wrong. If it could be sped up more (n threads till CPU-bound), this could exhaust/crash GuiProxy (DoS) in maybe a couple hours? (At least on 32-bit.)

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 Aug 29, 2014 10:00 am

Can you confirm Curt...? Or anyone else? Dispute? ;) Will it be fixed in the next version?

I just 1 minute anyone should be able to download the example program, Run Sandboxed, and see the memory usage grow (on XP or 7). Couldn't be simpler to check/observe; nothing else required now.

I left just one instance running (doesn't stop after a million) on clean, updated laptop XP install, and when I came back 10 hours later GuiProxy was already done at the 1.98/1.99 GB limit (I estimated losing 200 MB/hour).

Oh yeah, and there was something like 7,417,000 strings from Process Hacker in memory (min 4 chars), of course all garbage but a few, as I've reported last year after seeing millions of them...

But it wasn't crashing like I assumed, and everything still seemed to work after some simple checking. What's going on??

How is it able to continue after whatever usually needs to be allocated fails, without crashing?

As a side note, though I don't know what causes all the "Port" allocations/leaks, I figured out how to stop them: allocate all available memory. :P Yep, Ports no longer increase once memory is exhausted (not unexpected). But again, how is that possible when usually-necessary resources aren't available?!

Mr.X
Posts: 613
Joined: Sat Jul 13, 2013 9:34 am
Location: Mexico

Re: Memory leak(s), GALORE

Post by Mr.X » Fri Aug 29, 2014 3:07 pm

As a license paid user, I want Invincea team to answer DR_LaRRY_PEpPeR's questions. Please. :shock:
Windows 8.1 x64 EN | Sandboxie latest beta or stable | All software latest versions unless stated otherwise

Post Reply

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 24 guests