Jump to content
LaunchBox Community Forums
Strwrsteve

Memory leak or just my library?

Recommended Posts

Hi all, I am currently trying to figure out why Bigbox is eating all of my memory. I originally started with only 4 gigs of ram in the machine as i didnt think it would need much more than that but soon added another 4 gigs when windows kept showing "low system memory" notifications. If i leave bigbox open, it will slowly eat all the ram in the machine, usually after 3 hours. My original assumption was that with attract mode enabled, it would display the pictures for every game it stopped on and continue doing this, thus slowly eating up the memory as more and more images get loaded into memory. To this end i attempted to lower the quality of the images to lowest in the Bigbox settings but still run out of memory. I currently have in the realm of 4000 games running off of a Pentium G3258, 8gb ram, 128gb SSD (windows install, Launchbox is also installed here), and a 2.5TB HDD (data drive, roms are all stored here.) I have not yet tried lowering the number of roms in my library to see if that helps at all but am probably about to. Researching this however, i see a couple others with significantly larger library's than i running off of 4gb ram still. Anyone else having similar issues or is this limited to only myself?

Thanks,
   Strwrsteve
 

Share this post


Link to post
Share on other sites

Hi @Strwrsteve, how do you know if LB is "leaking"? Are you watching task manager memory working set and memory commit columns for launch box.exe and seeing it grow endlessly?

Maybe something else on your system is leaking (maybe not)?

How much memory do you have allocated for LB in Launchbox;s Options settings for memory? And how much commit memory do you see in task manager for launch box.exe?

Are you using a Beta build or a released version? 

Are you perhaps using a 32bit Windows operating system which cannot use more than 3.5GB ram total, and not more than 2GB per application?

 

Share this post


Link to post
Share on other sites

I dont actually know if BB is leaking but its the first thing that came to mind. In LB's memory options ive given it an incredibly generous max of 4GB thinking that would hopefully help. the machine is full 64 bit windows 7 and all 8 gigs are seen by the computer (save for 64m for video memory) and im running the latest build of 6.12. I got a screenshot of the resource manager when it was at roughly 5 gigs used. Thanks so far for attempting to help!

capture.png

Share this post


Link to post
Share on other sites

I think you need to reduce the LB size you allocated because it's too much for your system.

Try 2GB.

Edit:  I would even try 1GB if I were you. I run mine at 512MB default and it's fine. 

Edited by ckp

Share this post


Link to post
Share on other sites

So i just did that and well see how much differently it runs, but this was also happening when the ram cache was set at its default value of 512MB. i have noticed that the memory buildup was significantly slower when i set the image quality to lowest from medium this morning in BB. Unfortunately, thats the only real option for BB as i noticed there is no RAMCache setting in BB's settings.

Share this post


Link to post
Share on other sites

Jason said in another thread that the memory cache size set in desktop mode has no effect on BigBox mode.

That ram usage in the screen shot is absurd though, I just checked my usage in BigBox and it never got above 500 megs, it hovered around the 400 meg mark.

Maybe it's a theme ? I don't use any 3rd party themes.

Share this post


Link to post
Share on other sites

When I tried setting 2GB one time as a test, my LB process would use up about 1 to 1.2GB. Set to 512MB it uses around 550-650MB.

I never looked at the BB process though.

@Strwrsteve, keep an eye on your BB process in task manager, maybe take a screenshot of it after it's been running a half hour or so. Then keep checking it every 30 or 60 minutes to see it the commit column is steadily growing, and maybe exhibiting a growth pattern, like xxMB every hour. If it keeps growing endlessly, it's a memory leak. 

But I would recommend doing this with it set to no more than 2GB

Edit: I know @lordmonkus said the setting isn't "supposed" to affect Bigbox, but just in case that's a bug and it does, I would rather you catch the leak before your system becomes unstable. :) 

Edited by ckp

Share this post


Link to post
Share on other sites

If you see the process get really big again and it looks like a leak, you can right click the process in task manager in the Details tab and choose to create a memory dump. If @Jason Carr knows how to read those, it could be useful for him. Since you say it grew to >4GB even with a 512MB cache settings, it sure sounds like a memory leak unless it's almost 4GB already within a couple minutes after starting BB. If BB takes >4GB fairly quickly after starting BB, it would sound more like a bad memory allocation as opposed to a leak.

Edited by ckp

Share this post


Link to post
Share on other sites

It appears to be a rather slow process of eating it. Im currently going to do the 30 mins to every hour checkup and print screen idea you had @ckp and will do the memory dump once it climbs a good bit. Thanks once again for the help so far everyone.

  • Like 1

Share this post


Link to post
Share on other sites

Hi guys, memory dumps are mostly useless for me unfortunately. What video playback engine are you using @Strwrsteve? If we do have a memory leak, it would be with the videos most likely.

Share this post


Link to post
Share on other sites

Hey, sorry for the super late reply back. @Jason Carr, I do not currently have anything setup as far as the movies go, I can go ahead and do that when i get home if you think it might be of any help. What i have noticed is that the commit memory will continue climbing until it has used up most of the available page file, but the actual working set will stay at around 7.8 gigs used.

Share this post


Link to post
Share on other sites

Hmm, okay. I will review. We're using WPF/OS-level image caching for Big Box, so I think the OS should be doing a proper job handling it all. I'll take a look though to make sure.

Share this post


Link to post
Share on other sites

I did just add something to ensure that cleanup is happening properly; however, I wasn't able to replicate such high memory usage. I let Attract Mode go for around a half hour and memory on my system hovered around 1.2 gigs as CoverFlow images were loaded and disposed. This is with videos and all, and even while caching the images.

Give the latest a try @Strwrsteve to see if anything is improved for you. I suppose it's possible that Windows is just struggling to manage the memory because it's running out so badly and it's having trouble keeping up with cleanup due to heavy use of the page file, maybe. I'm not sure.

One thing I would suggest is an upgrade to Windows 10; Windows 7 is showing its age at this point (7 years old now which is a very long time in computer terms), and I wouldn't be surprised if there are some Microsoft glitches lurking around in Windows 7 that have been long fixed in the latest versions of Windows.

Share this post


Link to post
Share on other sites

Windows 7 still has several years left until Microsoft end of life's it. We use a LOT of Windows APIs in our desktop agent on all Windows OS versions at work and we don't have anything specific to win 7 vs win 10 that causes memory leaks only on win 7.  Win 7 is still used by a whole LOT of people and will be for a while.

@Strwrsteve, i hope the latest Beta indeed fixes this for you. It's a tough thing to debug since @Jason Carr can't reproduce the issue on a Windows 7 x86 system of his own.

I wonder if anyone else has watched their task mgr when running BB on Win 7 x64? I use Win 10 myself and mine stays < 600MB in BB attract mode. 

This looks like an interesting tool that I've been wanting to get around to looking at which may help to find the problem if it's a memory leak:

http://www.drmemory.org/

Jason, do you think it's worth a shot if the latest Beta doesn't help for him? Maybe you can give it a whirl @Strwrsteve ?

 

Share this post


Link to post
Share on other sites

More referring to issues with the .NET framework on Windows 7, @ckp, not Windows APIs. Also, he is already using x64. We can look into using further tools if this latest beta doesn't help.

Share this post


Link to post
Share on other sites

So for ultimate closure if anyone out there is looking for it, is that im living with it with a roundabout fix. I did in fact try to upgrade to Win10 and it DID in fact seem to help allot more. Memory leaking happened at a considerably slower pace than it did on Win7. However, do to the fact that it was still leaking, i went ahead and added a windows task that ran a batch file every 8 hours starting from logon. The batch file will warn any users of the impending restart and give them 30 seconds to exit the current game before killing the BigBox process and restarting it. This seems to be working a treat and as it will more than likely run at a time the arcade will not be in use, im quite fine with the current patch job until one update hopefully magically fixes it for me. Thanks again to everyone who tried to help me!

Share this post


Link to post
Share on other sites

I wonder if it's just certain video(s) too? Like maybe if you just have attract mode set to run inside one platform instead of all platforms, maybe that could help narrow down where the problem is more specifically? or maybe it doesn't matter. just a thought.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...