So I finally figured out what is going on.

How I found this is that in Firefox there is a plugin-container.exe process
running.  When the the slowness started that process jumps up to around 60%
CPU usage.  So I killed the processed and then Firefox displayed a message
about Adobe Flash crashed.

I implemented MooSound to play small sound files during the game.  I
commented out ALL usage of the MooSound and the memory issue and slow down
disappeared.

MooSound uses a 1px swf to play mp3 files, so either my usage of MooSound is
wrong or there is a problem with the MooSound or the swf file or with my
installation of flash.

I guess I could take MooSound out but I really like the audio during the
game, my problem now I guess is that I know very little about flash and have
no idea about where to begin debugging this.

Any suggestions?



On Mon, Jun 28, 2010 at 9:29 AM, Ryan Florence <[email protected]> wrote:

> Maybe I could add keys to play cards instead of drag and drop
>
>
> Or pop open the console and run your app with commands.  Whatever functions
> the onDrop (or whatever) calls you can just call manually to progress the
> game forward.
>
> I had a long running app that never got rid of keyboard events for a lot of
> widgets, so eventually when you hit a key about 100 events would fire (only
> one would do anything), soon as I fixed that the whole app ran much quicker.
>  Might also be something causing some slow down for you.
>
>
> On Jun 28, 2010, at 10:04 AM, Trevor Orr wrote:
>
> The problem with removing the drag feature is then there would be no way to
> complete a hand and proceed to the next hand.  Maybe I could add keys to
> play cards instead of drag and drop, like using the numbers (1 - x) to play
> specific cards.  That probably would not take much time to add, might  also
> be a nice option to the game.
>
>
>
> On Mon, Jun 28, 2010 at 8:58 AM, Aaron Newton <[email protected]> wrote:
>
>> Whenever you have a long running application (rather than something where
>> a new page is loaded often) you need to clean up your own memory usage. Drag
>> has methods for detaching itself from elements. This may or may not be your
>> problem, but there's an easy way to test it: remove the drag ability from
>> your app and see if it still leaks memory.
>>
>>
>> On Mon, Jun 28, 2010 at 7:14 AM, Trevor Orr <[email protected]> wrote:
>>
>>> That I think just pointed out my issue, here is where my problem is, I
>>> will explain the process,
>>>
>>> I have a class for a Card, card are HTML not images, so the card class
>>> creates a div with some html in it.  I create a drag class for each card and
>>> attach it to the card, I create a large copy of the Card div html that I use
>>> for the tooltip.
>>>
>>> This process is done for each card in each players hand.  So this could
>>> be 20 cards plus 20 tooltip card for each round of play. A separate drag
>>> class is attach to each card so that I can turn dragging on and off
>>> depending on who the current player is.
>>>
>>> Each player has an array of cards that are in their hand.  Once the hand
>>> is completed I loop through each player and just call empty() on the array
>>> of cards.  So by doing that does that leave the drag class and the tooltip
>>> around in memory?  Which could explain the increase in memory.
>>>
>>>
>>>
>>>
>>> On Mon, Jun 28, 2010 at 12:17 AM, Thierry bela nanga 
>>> <[email protected]>wrote:
>>>
>>>> Hi,
>>>>
>>>> the memory leak may come from your code, make sure you call
>>>> element.destroy() of every element you create as soon as they are no longer
>>>> used.
>>>>
>>>>
>>>>
>>>> On Mon, Jun 28, 2010 at 2:28 AM, Marc Weber <[email protected]>wrote:
>>>>
>>>>> Excerpts from Trevor Orr's message of Sun Jun 27 22:21:11 +0200 2010:
>>>>> > What I would like is suggestions of what kind of things I should be
>>>>> looking
>>>>> > at?
>>>>>
>>>>> Hi Trevor Orr.
>>>>>
>>>>> Firebug can profile JS. So if run that profiling for some secs, wait
>>>>> those 8 min and do it again you should be able to see what is consuming
>>>>> that much CPU. Maybe some arrays are filling up and iterating over them
>>>>> over and over again takes more and more time?
>>>>>
>>>>> Of course there cane be many more causes. I'd check this obvious first
>>>>> though because you said the slowness can be seen on different browsers.
>>>>>
>>>>> Marc Weber
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> http://tbela99.blogspot.com/
>>>>
>>>> fax : (+33) 08 26 51 94 51
>>>>
>>>
>>>
>>
>
>

Reply via email to