Page 2 of 2 FirstFirst 12
Results 11 to 12 of 12

Thread: stuttering movement

  1. #11

    Re: stuttering movement

    How about creating all the small but frequently used objects from a resouce pool, and free the object is just return it back to the pool. The referrence of such objects will never be 0 so the gc of javascirpt will never be trigered.

  2. #12
    Senior Member
    Join Date
    May 2010
    Posts
    207

    Re: stuttering movement

    Yeah - I'm doing essentially that already. I maintain arrays of objects that can be marked as "free" or "in use" - and instead of new'ing and deleting, I just flag them. However, if I temporarily need 1000 objects - then only two thereafter, then a lot of memory is wasted.

    But it's better than nothing.

    My problem was actually due to some code hiding down inside a third party matrix library that I hadn't looked at carefully enough. I've since rewritten that code.

    I suspect though that there are things that I may be doing that causes memory to be allocated and free'd in other ways though...stuff like closures are notorious for this kind of 'parasitic' allocation...I'm not using any of those - but I worry about what other hidden stuff there is out there.

Page 2 of 2 FirstFirst 12

Similar Threads

  1. How to implement flight movement?
    By mobilevisuals in forum OpenGL ES general technical discussions
    Replies: 1
    Last Post: 11-11-2009, 10:26 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •