• Dear forum reader,
    To actively participate in our forum discussions or to start your own threads, in addition to your game account, you need a forum account. You can
    REGISTER HERE!
    Please ensure a translation into English is provided if your post is not in English and to respect your fellow players when posting.
  • We are looking for you!
    Always wanted to join our Support or Forum Team? We are looking for enthusiastic moderators!
    Take a look at our recruitment page for more information and how you can apply:
    Apply
  • Forum Contests

    Won't you join us for out latest contest?
    You can check out the newest one here.

Forwarded: Memoryleak under Flash with most browsers

DeletedUser

Next Bug :

There is a memoryleak in FOE with the flashplayer under Firefox 11.0 (my PC had 4 GB RAM / Quadcore)
When you look at the attachment you see a screenshot from my taskmanager (in german) with 3 different states :
On the right side you see max memory usage
I have only FOE running and no other webpages with active flash
FF uses the "Plugincontainer" for any java / flash / thirdparty application

1. First you see memoryusage after 3 hours normal play (without any visit to my neighbours) :
667 MB RAM which is already to much for my opinion, but it gets better ...

2. After visiting some neighbours (exactly 5) you get :
802 MB RAM

3. And after some more neighbours (10) you are by:
1 GB RAM

This is the moment for me, when everything gets real sluggish and slow :(

I have only two solutions as far :
1. Kill the plugincontainer with the Taskmanager - FF autorestart a new one
2. Relogg ingame which sets some memory free (Down from 1 GB to about 100 MB)

Maybe another solution to this is to make some "garbage collection" ingame.
Right now you have FOE programmed with each visit to load the neighbourhood fresh from the server, but you also do not clean the memory after the visit, which makes really no sense IMHO (no offense really)
I also see the same problems with the "Techtree" "Continentalmap" and any random Combatmap you generate.
They also remain within the memory, which causes 667 MB Ram during "normal" gaming.

Edit: Added Screenshot from the WS-Tool (Flashmonitor) with full 1 GB usage
I started fresh with a new FF and Plugincontainer so it is reproducible.
Edit 2: Also reproducible with Chrome (see my post on page 2) so its not a browser issue ... it comes from the game

Greetings
Funonline
 

Attachments

  • Clip0001.jpg
    Clip0001.jpg
    54.3 KB · Views: 669
  • WS-Mon.JPG
    WS-Mon.JPG
    23.9 KB · Views: 620
Last edited by a moderator:

DeletedUser

Hmm, didnt notice anything at my pc.
I also use firefox 11.0, and i have about 3/4 gb RAM.
Intel(R) Core(TM)2 Duo CPU E8400 @ 3.00GHz

How bad did the lagg become if you just let it be? Impossible to miss?
I didnt check my taskmanager yet, but it will probably be the same as you :)
 

DeletedUser

Yep, and it's not browser-dependent. You don't even have to be doing anything like visiting neighbors. Leave the game open for more than an hour and even on my very high end computer there's a noticeable slowness to the game. Animations stutter, transitions to other screens take longer, etc. Open this tool in another browser tab while playing FoE and you'll notice that it continues to rise and rise and rise over time.

Possible causes:
As a disclaimer, I obviously don't know anything about their programming for the game, but I've run into some memory leaks over extended periods of time in some Flash games I've made before and might be able to help? It's worth listing out at least. Based on what I see in the game, maybe it's one of these issues?

  1. They create a new movie clip but never remove it. It could be the people who walk on the streets in the game, or the icons that float overtop buildings. Hiding it does not mean removing it. The people on the streets randomly appear, and randomly disappear, which is why it grabs by attention.
  2. Similar issue, maybe they're duplicating event listeners. Something like click listeners for houses have multiple event listeners on it that do the same thing, rather than removing the old listener and adding another.
  3. Flash's garbage collector is pretty bad in general. If an object is large enough, the GC never cleans it up. And this game has a lottttt of data to it. A lot of this comes back to event listeners and remembering to use the removeEventListener() method as often as possible.
  4. As a more specific case, what funonline suggests is clearly a problem. It sounds as though all the data and information about the neighbor you visit is never removed. Opening the map and closing it leaves a mark on your memory use. Same with the technology tree, the battle screen, and so on.

Hopefully this doesn't come across as sounding like I'm telling them how to program. Just trying to be helpful as a beta tester for the technical side of the game. Flash has a profiler built into it for finding the cause of a memory leak and I think the developers should definitely look into it. Take a snapshot at the beginning, leave the game running for an hour or play it and then take another snapshot.

I hope that helps, and hope that this gets read.
 
Last edited by a moderator:

DeletedUser

The 1 GB lagg is hard to miss really, after this point (each pc reacts a little bit different, depending on OS / RAM/ etc) my PC begin to swap into pagefile.
And each action I took afterwards with FF or other programms took XXX amount of time compared to the "normal" state.
Ingame you see each loadingscreen took nearly forever (in example : serveral minutes to switch between village and techtree, and back)

When you take a look at my taskmanagerscreen you see the third column which is CPU-Usage
I have a Quadcore so 25 % CPU for one process means 100 % with a Singlecore CPU
This is not only the swapfile which causes the lagg, also the CPU is working at full capacity for this process.
 
Last edited by a moderator:

DeletedUser

Hmm, i understand.
I will try running the tool tomorrow too, so they will have multiple sources, and will see the problem needs to be solved.

Might be fun to try create something with flash sometime, i am studying Informatica at the moment, but we don't do anything with flash.
Java and some other languages have objects that are automatically removed by a garbage collector. I am assuming this is about the same thing.

I will post screenshots when i have solid results about this problem! :)
 

DeletedUser

Actually it is browser related and nothing to do with the game, from my side.
I'm an opera user and I do not have a plugin container and so my browser doesn't reach so high memory use.
 

DeletedUser

Actually it is browser related and nothing to do with the game, from my side.
I'm an opera user and I do not have a plugin container and so my browser doesn't reach so high memory use.

It is NOT browser related. The "plugin container" is what Firefox wraps Flash in. But it also uses the "plugin container" for its addons and extensions, so it'll be higher for Firefox. Other browsers just use the browser itself to use Flash, so you'll see its high memory listed in the Task Manager as the browser. I tested in Chrome, Firefox, Opera, and Safari and noticed the memory jump after visiting a few different neighbors. Or even the same neighbor over and over. But as I mentioned before, if you just let it sit for a few hours there's a noticeably high memory usage.

It won't be noticeable for a lot of people who open the game, collect their stuff, and close it. It won't be noticeable for players who do more in-depth playing either like trading and conquering. It's really only the extreme cases that are affected, but it's still a memory leak.

EDIT: The tool a linked to in my previous post is better for narrowing down how much memory Flash is using than the task manager, and focuses on Flash only rather than the whole browser. I started it up when I wrote my first reply and it only used 188 MB. Now, 30 minutes later, it's using 506 MB.
 
Last edited by a moderator:

DeletedUser

Yes, memory jump by a slight difference when visiting a neighbour but it's not that much for it's graphics(think that it must load pretty much data).
This happens for all flash games because they have to load data, much data in this case, but the load it's not even close as much as you say.
For example I have 7 tabs open right now(game included) and my browser stays at near 500k
 

DeletedUser

I get about 520k at best. But i just logged in again.

I will try in detail tomorrow if letting the browser run some time, without logging in again, is the difference. However, it makes sense to me.
Cant test it right now, cause im off to bed =)

And @emi.
The problem isnt that it loads a lot of data, and the use gets pretty high.
The problem is that when you leave your browser on, without relogging etc, it gets higher and higher.

But see you tomorrow, gotta sleep now... long day ahead of me :/
 

DeletedUser

I am testing it right now with the provided tool above.I'm pretty sure there is no problem within,i will reply 30 min later with the results.
I'm pretty sure that it's a firefox related issue.
 

DeletedUser

I'm pretty sure that it's a firefox related issue.

If that were true, why would I be getting the same results in every browser? I think you might be underestimating just how separate Flash and any browser is. They're separate entities. It's the game, not the browser.

Since my last post, after doing general gameplay like collecting from houses and setting some production buildings, Flash is now at 668 MB memory usage after 45 minutes of playing. Things like the "+XX gold" that rise up over a house after clicking it are starting to have a slight stutter to their animation and I have 8 GB of RAM. It might only be 668 MB out of 8000, but the system allocates the browser memory, and Flash is allocated memory by the browser.

It should be said that if you refresh the page, the Flash player is reset and memory levels go back to normal. It's only when you leave the game up continuously that it's a problem.
 

DeletedUser

I have 207 mb which is dropping if i don't do anything there ,after 20 minutes, this is far from your 566 mb, by the way, has your video card memory share?
 

DeletedUser

I have 207 mb which is dropping if i don't do anything there ,after 20 minutes, this is far from your 566 mb, by the way, has your video card memory share?

Did you literally do nothing? You should be collecting and setting and other regular gameplay, or otherwise you're testing the extreme case where you do absolutely nothing, in which you'd probably have to wait 10 hours to notice the issue. Just curious, what does it list as your "min" and "max" with the WSMonitor tool?

I have hardware acceleration enabled and my video card is near-top-of-the-line. Not that it matters, since the real issue here is the increasing memory use, not the speed of the game. The increasing memory use slows down the game, yes, but the slowness of the game doesn't affect increasing memory use.
 

DeletedUser

No, actually I visited a couple of neighbours,recruited 2 units,collected from about 10 houses,browsed my lumber mill my good list, murble
MIN:11.33 MB(before starting the game)
MAX:295.78MB
Currently:273.15MB
After 30 minutes.
I can agree it's a bit high for a browser game, but i can't agree that kind of usage over 1GB!
 

DeletedUser

No, actually I visited a couple of neighbours,recruited 2 units,collected from about 10 houses,browsed my lumber mill my good list, murble
MIN:11.33 MB(before starting the game)
MAX:295.78MB
Currently:273.15MB
After 30 minutes.
I can agree it's a bit high for a browser game, but i can't agree that kind of usage over 1GB!

So you're higher now (273 MB) than when you wrote your last post (207 MB), a 30% increase. Yes it's a big game and it's going to use a lot of memory. That's not the issue. The issue is that it continues to use more and more over time. At 30 minutes, it won't be that noticeable. But give it 2 hours and you'll find the game frustratingly slow. In my opinion, you and others helped confirm the bug exists on different browsers and different systems.
 

DeletedUser

I'm pretty sure that it's a firefox related issue.
I can agree it's a bit high for a browser game, but i can't agree that kind of usage over 1GB!

So after a fresh clean brandnew install from Chrome ... here some funny facts about chrome and a another screenshot ;)

You only see chrome with only one page open (FOE):
1. Start clean with 280 MB Usage (sry not on screen)

2. After 5 neighbours 484 MB RAM usage (first taskmanagerscreen)

3. After some gaming and more neighbours 765 MB RAM usage and here it becomes real funny ... chrome is already at this moment at full limit and endless slow

4. And more neighbours 1 GB
Uuuups I did it again ... :rolleyes:

Sure we also could try this in every browser on the market, but after the same result with the two "main" browsers I think its a legit conclusion to say its NOT browser related ... it is a design flaw (no offense again pls)

BTW: Chrome feels really slow for me at FOE compared to Firefox already at the "basic" gameplay (without any neighbourhood bombing)

Greets
Funonline
 

Attachments

  • chrome-1gb.JPG
    chrome-1gb.JPG
    85.4 KB · Views: 403
Last edited by a moderator:

DeletedUser

I've let it run since my first reply here, 6 hours ago, and the game is now using 1.2 GB of memory.
 

DeletedUser

The problem is also:
The bigger and more complex players' towns become, the slower the game and the more memory it eats up.
So when starting fresh, you may not notice this issue so much, but once you and your neighbors have like 50 houses and 40 supply buildings, your system is really pushed to the limit if you don't restart the browser every hour or so.

Even though this is not a bug in it's original sense (I'd classify it as a design issue), I'm setting this to "Confirmed"
 

DeletedUser

The problem is also:
The bigger and more complex players' towns become, the slower the game and the more memory it eats up.
So when starting fresh, you may not notice this issue so much, but once you and your neighbors have like 50 houses and 40 supply buildings, your system is really pushed to the limit if you don't restart the browser every hour or so.

Even though this is not a bug in it's original sense (I'd classify it as a design issue), I'm setting this to "Confirmed"

How do you not consider it a bug, haha? The game is going to use a lot of memory, that's accepted, and that's a design issue, but that's not the bug we're talking about. The bug is that the game has a memory leak and continues to use more and more memory if left open, even if you do not do anything.
 

DeletedUser

Alright:
at the start: 200k
25 minutes later, while playing a lot: 325k
15 minutes after that & relog: 180k
75 min later 415k.

At the moment while playing just a little bit:
almost 500k.

Just relogged again, and its back to below 250k atm.

It certainly is a bug where some objects arent properly destroyed.
Can become quite a hindrance, especially when people get more of these objects in the software.

A bug that slows the game down, and should be fixed :)
I didnt get that program working alright, so i just did it with my task manager.
 
Top