iOS memory leak

Discussion in 'RPG Maker MV Deployment' started by nuevocharrua, Nov 24, 2015.

  1. nuevocharrua

    nuevocharrua Villager Member

    Messages:
    12
    Likes Received:
    0
    First Language:
    Spanish
    In a simple game with a few maps, without any plugin, after trying for 30 minutes after trow many "Memory Warnigs", the game crash and throw: "Terminated due to memory issue"

    (Im using Apache Cordova)
     
    #1
  2. Shaz

    Shaz Veteran Veteran

    Messages:
    37,914
    Likes Received:
    11,586
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    This is when playing the game, or when using the editor? And using the steam version?
     
    Last edited by a moderator: Nov 24, 2015
    #2
  3. nuevocharrua

    nuevocharrua Villager Member

    Messages:
    12
    Likes Received:
    0
    First Language:
    Spanish
    Im run the game on IPhone,

    And yes, is the Steam Version , but the error only happens on IPhone deployed (not in xcode Simulator)
     
    Last edited by a moderator: Nov 24, 2015
    #3
  4. nuevocharrua

    nuevocharrua Villager Member

    Messages:
    12
    Likes Received:
    0
    First Language:
    Spanish
    any ideas?
     
    #4
  5. orlando

    orlando Veteran Veteran

    Messages:
    177
    Likes Received:
    84
    This might be due to the fact that images for new maps are always loaded, and apparently never unloaded. You can try this code in js/plugins/ and see if it helps with this:

    (function() {// When loading a new map, consider throwing stuff away:DataManager._oldPreCacheWiper_loadMapData = DataManager.loadMapData;DataManager.loadMapData = function(mapId) {    if (typeof(DataManager._lastSeenMap) == "undefined") {        DataManager._lastSeenMap = -1;    }    if (mapId != DataManager._lastSeenMap) {        // Purge image data:        ImageManager.clear();        // Remember new map id:        DataManager._lastSeenMap = mapId;    }    return DataManager._oldPreCacheWiper_loadMapData(mapId);}})();This might possibly become part of Galenmereth's Preload Manager at some point, but right now it isn't.

    Edit: snippet bugfix, referenced to non-existant class before
     
    Last edited by a moderator: Nov 27, 2015
    #5
  6. nuevocharrua

    nuevocharrua Villager Member

    Messages:
    12
    Likes Received:
    0
    First Language:
    Spanish
    Thanks

     

    The script works fine! The game still throwing warnings , but not crushed.

    It has some issues: The map name is shown with black font, and the first damage in battle is shown with glitches
     
    #6
  7. orlando

    orlando Veteran Veteran

    Messages:
    177
    Likes Received:
    84
    Are those problems caused by the plugin? (does it work correctly without it?)

    If yes, I'll see and check if I can fix it.
     
    Last edited by a moderator: Nov 27, 2015
    #7
  8. nuevocharrua

    nuevocharrua Villager Member

    Messages:
    12
    Likes Received:
    0
    First Language:
    Spanish
    I think so, but did not try it without my plugins.

    I think not load the font image using to show damage.
     
    #8
  9. Shaz

    Shaz Veteran Veteran

    Messages:
    37,914
    Likes Received:
    11,586
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    Can you try this fix from Ramiro and see if it improves things?


    Also, the issues with map name and damage display - were they already happening, or did they just start happening after you added blubberblubb's plugin? (if you disable that plugin, do the issues still happen)? And what are the warnings that are still being thrown?


    Some things (almost anything in the System folder) should not be cleared, and that may be the cause, but you didn't really say in what way the damage in battles was "glitched".
     
    Last edited by a moderator: Nov 30, 2015
    #9
  10. nuevocharrua

    nuevocharrua Villager Member

    Messages:
    12
    Likes Received:
    0
    First Language:
    Spanish
    The blubberblubb's plugin solves the memory error, but now have this "glitch" (first damage)

    [​IMG]

    the blubberblubb's plugin is the only active plugin  
     
    #10
  11. Shaz

    Shaz Veteran Veteran

    Messages:
    37,914
    Likes Received:
    11,586
    Location:
    Australia
    First Language:
    English
    Primarily Uses:
    RMMV
    I don't see how that plugin could possibly cause that issue unless you have another plugin enabled as well. Unless it is simply because the system files have been cleared from cache as well.

    If you disable the plugin, does it still happen?
    If you start a brand new project and ONLY add blubberblubb's plugin, does it still happen?

    Edit: I've just finished making this.  I've tested it on PC and it works as I expect, though my testing was pretty basic.  I haven't tried running it on any mobile devices.
     
    Last edited by a moderator: Nov 30, 2015
    #11

Share This Page