Canvas memory saturation (Bug?)

About Monkey 2 Forums Monkey 2 Development Canvas memory saturation (Bug?)

This topic contains 4 replies, has 3 voices, and was last updated by  abakobo 2 years, 1 month ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #7273

    abakobo
    Participant

    The following code will throw a memory access violation after a some time. If the “New Canvas(im)” is not in a loop the memory will keep stable.
    I could not find a Discard() method for canvases so I suppose it’s some GC but. (Or we’re not supposed to locally/loop New Canvases but that would be a bit strange)

    [/crayon]
    #7280

    nerobot
    Participant

    Why do you create new canvas each render frame? 🙂

    Even if it will be removed by GC correctly – it looks like unnnecessary allocation.

    #7281

    abakobo
    Participant

    Why do you create new canvas each render frame?

    I don’t, I just saw the bug(if it is) with some random simple test code.

    #7341

    nobuyuki
    Participant

    check this thread out, it may be helpful even though it’s old:  http://www.monkey-x.com/Community/posts.php?topic=9473&post=98448&view=all#98448

     

    It relates to Images rather than Canvas but the notes on how the GC works near the end are probably still useful.

    #7351

    abakobo
    Participant

    Does this mean that canvas should discard the passed image!?

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.