Jump to content
Search Community

VideoLoader RAM usage endlessly grows grows

ahainen test
Moderator Tag

Recommended Posts

Alright, I'm 100% stuck, and I really need some help with my project. Below is a link to the FULL project so you can see everything that's there and test it yourself. It's 180MB, sorry for the filesize, but its like 78MB of video and some sound and other things.

 

http://www.mediafire.com/?5eox4gderare717

 

The project is one frame, on the frame there is a movie clip called rewinder. inside rewinder theres about 24 frames that left and right arrows on screen navigate between, and plays different videos. I'm loading videos 2 in front and 2 behind the current frame, and unloading any videos outside that threshold, but it's not helping. Further details but not super relevant I dont think: the swf is referencing a php file every 2.5 seconds that has a variable I'm using.

 

The problem: Run the swf, and you'll see your RAM usage and CPU usage skyrocket. I've compressed the videos as much as I can, I'm using Loadermax, loading the videos when needed, unloading them when they're not needed, but it's just detrimental to the computer. It literally starts to crash other programs and slow the computer down because it's too intense on it. I don't know what the problem is or how to fix it.

 

Furthermore, when you navigate pages, the RAM usage endlessly goes up well beyond 1GB.

 

Is there a way that I can test where a memory leak is occuring? Does this seem like a LoaderMax issue?

 

I'm a designer primarily and trying to work with AS3 and greensock, so I apologize that the code isn't refactored well or optimized.

 

Any help would be TREMENDOUSLY appreciated, please let me know if I can supply with anything else thats needed for testing. The project is up and online at www.helpg.us. Please don't post that link around right now, just saying that so you can see the full file online running.

Link to comment
Share on other sites

I'm so sorry to hear about the frustration. I know it can be maddening and intimidating to be a designer attempting to understand a coding challenge and it just ain't working, yet the deadlines are looming. Unfortunately we just don't have the resources to offer free general troubleshooting for entire projects like that. I'm pretty sure the problem doesn't stem from bugs in LoaderMax because very large, video-heavy projects have been tackled using it and they didn't have memory leaks. Plus with many thousands of people using the platform, usually bugs like that would bubble to the surface relatively quickly. Then again, it's always possible that there is a problem with the system but I'd need you to isolate the problem in a much more simplified FLA with only the minimum code necessary to show that the problem does indeed lie with LoaderMax most likely. It takes a lot of time to dig into someone else's entire project and try to understand the intent, get comfortable with the coding style, find how things interconnect, and isolate where exactly the problem is coming from. To be honest, over 90% of the time the problem is with the end user's code.

 

I wish I had more encouraging news for you, but again, we'd be happy to look at a simplified FLA that clearly indicates that the problem likely lies with LoaderMax or some other GreenSock tool. Another option for you would be to hire an ActionScript pro to dig in and find out what's going on in your project and solve the issues.

 

Of course if anyone else in these forums has the time and inclination to crack open the files and find out what's going on, that'd be great.

Link to comment
Share on other sites

Hi, thanks for the reply. Here's a smaller version I made for a Stackoverflow post a little while ago. This is the same project, but it just loads two videos, and doesn't use the threshold unloading in the actual project (because there's only two videos.) The RAM usage and CPU usage are really high in this too.

 

http://www.mediafire.com/download.php?ejy6j9h9r1c1829

 

The reason I thought it was LoaderMax, is because if you sit on the first frame it stays at around 400MB of Real Memory indefinitely. Once I go to the next frame, it goes up, of course, but it never comes down or seems to unload, and the RAM usage only changes upon changing the frame, which is just loading another video.

 

I'm working with a a programmer today to tray and figure it out, Im really hoping there's some loop somewhere just bloating it and can be removed. Thanks for the response though, I appreciate it.

Link to comment
Share on other sites

I'm not at a spot right now where I can analyze all your code and isolate memory leaks for you, but I did notice a few things:

 

1) You are calling advance() and rewind() methods that run logic based on "currentFrame" and "totalFrames" but did you realize that you had 21 frames inside that "voltageBar" layer folder? It seems like maybe you were intending for there only to be 3 frames (that's how many you have with ActionScript) but the advance() method would cause things to advance beyond the end of you regular layers and consequently they keep going until frame 21 and then loop back to frame 1. Then, on frame 1, you are creating ALL YOUR LOADERS AGAIN, which would explain why memory keeps going up. You never disposed of the old ones and you're creating a bunch of duplicates. Add a trace() to frame 1 of your "rewinder" MovieClip and you'll see that it's getting called multiple times (which runs that code on the frame creating your loaders).

 

2) You add event listeners but never remove them. This isn't necessarily a deal-breaker but I wanted to mention it so that you're mindful of it. In general, remove listeners when you don't need them anymore.

 

I hope that helps. #1 is almost surely the cause of your problems.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...