1. Hello Guest! It's with a heavy heart that we must announce the removal of the Legacy GMC Archive. If you wish to save anything from it, now's the time! Please see this topic for more information.
    Dismiss Notice

3D Out Of Memory (How clean?)

Discussion in 'Programming' started by Duran38, Dec 8, 2017.

  1. Duran38

    Duran38 Guest

    Hi boys, we are creating 3D Rpg game and creating so much 3d models inside game. (like 600-700) and so much using shaders.. etc
    But Game maker 1.4 creating error "Out Of Memory". How can we clean memory? Any tips ?

    thank you for all anwsers
     

    Attached Files:

  2. FrostyCat

    FrostyCat Member

    Joined:
    Jun 26, 2016
    Posts:
    4,689
    The best way to clean memory is to minimize your use of it in the first place.

    Load only the models you are actively drawing, don't load in all of them at once. Watch where you are loading models and make sure you don't load the same one repeatedly. Have Task Manager open and watch for whether and when the RAM usage is climbing up without going back down.
     
    Duran38, andev and ParodyKnaveBob like this.
  3. Halph-Price

    Halph-Price Member

    Joined:
    Mar 20, 2017
    Posts:
    42
    That's actually kind of impressive... XD
     
  4. icuurd12b42

    icuurd12b42 TMC Founder GMC Elder

    Joined:
    Apr 22, 2016
    Posts:
    1,840
    I seen this error encountered on 2 cases
    1) Happens when you allocated too much memory with data structures and forgot to free your ds. run the task manage and see if your game accumulates memory, the error happens around 1.6 GB of allocation and may take some time to reach that point during the course of running the program.
    Check if you ds_XXX_create without freeing things.
    It can also happen with using arrays. to free an array set the variable that holds it to 0

    2) It's actually the GPU that ran out of space either for the (2A) textures or for the (2B) render buffer... Usually the error reported is more distinguishable as a gpu memory problem, but I have seen it reported misleadingly as a simple memory error. if that is your problem the crash would be (almost) instantaneous and the task manage would not show a lot of memory used.
    -2A
    - See if you surface_create() without calling surface_free() when done.
    - See if you can reduce the texture page size in the game setting

    2B
    -You can split the render buffer by calling d3d_transform_set_identity() to split the draw batch, for example. if you have a loop that draws a ton of images or vertices, or if you have a loop that build a huge model, you may need to break it apart so each part draw before you run out of buffer space
     
    Duran38, andev and ParodyKnaveBob like this.
  5. Duran38

    Duran38 Guest

    Your recommendations worked well thanks.
    + I just upload the models I'm close to.
    + I clean up many Array and DS_list.

    If you dont have an idea, why are you undermining it? Just get away...
     
  6. rIKmAN

    rIKmAN Member

    Joined:
    Sep 6, 2016
    Posts:
    4,745
    Nice response to someone complimenting what you've achieved with 3D in GMS.
     
    kupo15 and Desix like this.

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice