Welcome
Welcome to the Castle Age AutoPlayer forums

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

Memory Leakage

Discussion and information regarding the current Community Build

Memory Leakage

Postby Xotic750 » 08 Jan 2013, 19:50

So, I've tried quite a few things now.

First I began with nullifying variables that relate to the DOM (mainly variables assigned DOM values with jQuery), this didn't seem to have any improvement.

I then changed event binding techniques to use the lates jQuery methods, this seemed to give some improvement but did not solve the major leakage.

I upgraded all libraries to the latest version in case the older ones had any serious problems, this made little or no difference.

On my local copy I have commented out every event binding that CAAP assigns to the DOM (just as a test), as these are often causes of memory leaks in Javascript, but this has made no difference.

So, I' not sure where the leak is coming from but it definately happens after CAAP has been loaded and a page refresh occurs, either manual or programatically. So something is causing the memory not to be released, all I can continue to do is try commenting out bits of code and performing page refreshes to see if I can figure out where and why this is happening. It's a very slow process. If anyone gets a lead on the problem then please post it here.
ImageImage
User avatar
Xotic750
Site Admin
Site Admin
 
Posts: 391
Joined: 14 Jun 2011, 16:47
Location: Stockholm
Has thanked: 15 time
Have thanks: 89 time

 

Re: Memory Leakage

Postby LordBandit » 08 Jan 2013, 20:34

I've noticed that when my profiles crash it is usually during the income/banking or monster review. You might start with those first... I have shut off auto-banking and just leave the gold sit and that has helped some....but it's not all of it.
LordBandit
Moderator
Moderator
 
Posts: 652
Joined: 21 Jun 2011, 20:30
Has thanked: 109 time
Have thanks: 52 time

Re: Memory Leakage

Postby Xotic750 » 08 Jan 2013, 20:48

It's something more basic than those, as I have it just sitting on the index page and not navigating or doing anything but when I refresh the page or CAAP refreshed the page due to its timer then the memory leak happens.

Just now I am disabling the dashboard code and everything related to that to see if that changes anything.

It's possible that it is not a leak/fault in CAAP code or CA or FB code, but could be a side effect of all this Javascript acting on the same page that causes something strange to happen.
ImageImage
User avatar
Xotic750
Site Admin
Site Admin
 
Posts: 391
Joined: 14 Jun 2011, 16:47
Location: Stockholm
Has thanked: 15 time
Have thanks: 89 time

Re: Memory Leakage

Postby Xotic750 » 08 Jan 2013, 20:53

After disabling all the dashboard code, the memory leak on refresh still occurs.

next I am going to try disabling the control panel code (the main CAAP panel on the right hand side), so CAAP with then not be interacting (changing/adding/removing element/events) with the DOM in any way.
ImageImage
User avatar
Xotic750
Site Admin
Site Admin
 
Posts: 391
Joined: 14 Jun 2011, 16:47
Location: Stockholm
Has thanked: 15 time
Have thanks: 89 time

Re: Memory Leakage

Postby LordBandit » 08 Jan 2013, 20:55

This past weekend while watching American Football :) I turned on the task manager for a few of my profiles and even while caap was disabled (was doing a guild battle and waiting for tokens to regen) the memory just kept climbing.
LordBandit
Moderator
Moderator
 
Posts: 652
Joined: 21 Jun 2011, 20:30
Has thanked: 109 time
Have thanks: 52 time

Re: Memory Leakage

Postby LordBandit » 08 Jan 2013, 20:59

I remember from college VB5 course that timers would cause a lot of memory usage and our instructor always told us to use them very sparingly. It seems that caap has timers for a LOT of things...could these be causing any of the problems??
LordBandit
Moderator
Moderator
 
Posts: 652
Joined: 21 Jun 2011, 20:30
Has thanked: 109 time
Have thanks: 52 time

Re: Memory Leakage

Postby Xotic750 » 08 Jan 2013, 21:48

I have now radically cut out code from CAAP by preventing code from running at all after initialisation stage by commenting out in functions.js

Code: Select all
//caap.start();


and I still get a massive memory leak with a manual refresh of the page. :o

There is very little code left to comment out now.
ImageImage
User avatar
Xotic750
Site Admin
Site Admin
 
Posts: 391
Joined: 14 Jun 2011, 16:47
Location: Stockholm
Has thanked: 15 time
Have thanks: 89 time

Re: Memory Leakage

Postby Xotic750 » 08 Jan 2013, 22:00

i have now gone as drastic as can commenting out all CAAP code initialisation by commenting out in begin.js

Code: Select all
//setTimeout(caap_start_all, 5000);


And still the same memory leak on a page refresh.


All I can do now is go into the manifest.json file and start commenting out the following files so that they are not even available in the extension.

Code: Select all
            "js": [
                "extern/jquery.js",
                "extern/jqueryui.js",
                "extern/farbtastic.min.js",
                "extern/jquery.dataTables.js",
                "extern/utility.js",
                "js/head.js",
                "js/image64.js",
                "js/offline.js",
                "js/profiles.js",
                "js/css.js",
                "js/sort.js",
                "js/general.js",
                "js/monster.js",
                "js/guild_monster.js",
                "js/festival.js",
                "js/feed.js",
                "js/battle.js",
                "js/spreadsheet.js",
                "js/gifting.js",
                "js/town.js",
                "js/army.js",
                "js/caap_base.js",
                "js/caap_alchemy.js",
                "js/caap_army.js",
                "js/caap_autogift.js",
                "js/caap_autoincome.js",
                "js/caap_autostat.js",
                "js/caap_bank.js",       
                "js/caap_battle.js",
                "js/caap_cta.js",
                "js/caap_demi.js",
                "js/caap_display.js",
                "js/caap_eliteguard.js",
                "js/caap_festival.js",
                "js/caap_fillarmy.js",
                "js/caap_guild.js",
                "js/caap_guildbattle.js",
                "js/caap_guildmonster.js",
                "js/caap_heal.js",
                "js/caap_idle.js",
                "js/caap_index.js",
                "js/caap_jquery.js",
                "js/caap_mainloop.js",
                "js/caap_monster.js",
                "js/caap_monsterdash.js",
                "js/caap_navigation.js",
                "js/caap_passivegeneral.js",
                "js/caap_playerrecon.js",
                "js/caap_potions.js",
                "js/caap_quest.js",
                "js/caap_start.js",
                "js/functions.js",
                "js/begin.js",
                "js/conquest.js",
                "js/arena.js"
            ],
ImageImage
User avatar
Xotic750
Site Admin
Site Admin
 
Posts: 391
Joined: 14 Jun 2011, 16:47
Location: Stockholm
Has thanked: 15 time
Have thanks: 89 time

Re: Memory Leakage

Postby Xotic750 » 08 Jan 2013, 22:09

I have changed my manifest to include just the following files

Code: Select all
            "js": [
                "extern/jquery.js",
                "extern/jqueryui.js",
                "extern/farbtastic.min.js",
                "extern/jquery.dataTables.js"
            ],


I still get the problem.

it would be great if someone else can confirm they also see the memory leak upon a manual page refresh.

this is as much I have time for just now, but it's either the background.html, one of the above library files, or even something with chromium or extensions in general.
ImageImage
User avatar
Xotic750
Site Admin
Site Admin
 
Posts: 391
Joined: 14 Jun 2011, 16:47
Location: Stockholm
Has thanked: 15 time
Have thanks: 89 time

Re: Memory Leakage

Postby Xotic750 » 08 Jan 2013, 22:37

This is how the leakage looks with the above manifest.json changes. each increase of memory is when I hit the refresh button.

memleak1.png
memleak1.png (65.2 KiB) Viewed 2505 times
ImageImage
User avatar
Xotic750
Site Admin
Site Admin
 
Posts: 391
Joined: 14 Jun 2011, 16:47
Location: Stockholm
Has thanked: 15 time
Have thanks: 89 time

Next

Return to Community Build

Who is online

Users browsing this forum: No registered users and 1 guest

cron
suspicion-preferred