Results 1 to 10 of 10

Thread: Releasing DTMs

  1. #1
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default Releasing DTMs

    What happens when you don't release DTMs or bitmaps that were loaded? Isn't it stupid to load DTMs and release them over and over again, when you could just load them at startup and go on?
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

  2. #2
    Join Date
    Mar 2012
    Location
    Color :D
    Posts
    938
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I had a procedure to load all my DTMs before the mainloop. Then had a procedure that free them all too, and added it into this function.
    Simba Code:
    AddOnTerminate('FreeAllDTMs');

    So when the script terminates, it will free my dtms. And I don't need to load and free the dtm everytime in a procedure or function. Well, that's just what I do in my scripts, not sure about others.

  3. #3
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Quote Originally Posted by litoris View Post
    What happens when you don't release DTMs or bitmaps that were loaded? Isn't it stupid to load DTMs and release them over and over again, when you could just load them at startup and go on?
    1) You clog up your memory.

    2) Yes.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  4. #4
    Join Date
    Jul 2011
    Location
    /home/litoris
    Posts
    2,226
    Mentioned
    0 Post(s)
    Quoted
    159 Post(s)

    Default

    Quote Originally Posted by Rich View Post
    1) You clog up your memory.

    2) Yes.
    Simba doesn't release DTMs and such when script is terminated right? I will use cephaxz's method I suppose.
    Miner & Urn Crafter & 07 Chicken Killer
    SPS BlindWalk Tutorial

    Working on: Nothing

    teacher in every art, brought the fire that hath proved to mortals a means to mighty ends

  5. #5
    Join Date
    May 2007
    Location
    England
    Posts
    4,140
    Mentioned
    11 Post(s)
    Quoted
    266 Post(s)

    Default

    Quote Originally Posted by litoris View Post
    Simba doesn't release DTMs and such when script is terminated right? I will use cephaxz's method I suppose.
    Yup, you have to do it manually.
    <3

    Quote Originally Posted by Eminem
    I don't care if you're black, white, straight, bisexual, gay, lesbian, short, tall, fat, skinny, rich or poor. If you're nice to me, I'll be nice to you. Simple as that.

  6. #6
    Join Date
    Jan 2012
    Posts
    125
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    if you dont release them eventually it will crash( i learnt the hard way)

  7. #7
    Join Date
    Feb 2012
    Location
    Wonderland
    Posts
    1,988
    Mentioned
    41 Post(s)
    Quoted
    272 Post(s)

    Default

    Even if you clog up your memory, a simple reboot will clear all that, no?

  8. #8
    Join Date
    Apr 2012
    Posts
    157
    Mentioned
    10 Post(s)
    Quoted
    57 Post(s)

    Default

    yes, even restarting the program would theoretically reset the memory cache for it. But while your script is running you will just be chewing away at memory. It will just cause crashing in the long run.

  9. #9
    Join Date
    Oct 2011
    Posts
    805
    Mentioned
    21 Post(s)
    Quoted
    152 Post(s)

    Default

    Simba actually release all bitmaps and DTMs automatically when script is terminated. But if you create more and more new bitmaps/dtms when script is running and don't free any you will flood your memory and you can end with error:
    Error: Exception: Out of memory at line 22

  10. #10
    Join Date
    Jul 2010
    Posts
    1,115
    Mentioned
    1 Post(s)
    Quoted
    10 Post(s)

    Default

    the reason many people choose to release within each procedure is that if they have alot, eventually they wouldnt be able to load them all at the beginning and release at the end so they just release within each procedure/function in case they add more

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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