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