System Memory error.

inkBotinkBot Posts: 42
edited May 8 in Bug reports
So I was working on my big animation file, and was going to save another iteration of it. But the program gave me an error prompt and refused to save the file. When trying to remove parts of the file I no longer need (selecting them all at once and deleting them) the program outright crashed on me.

This is the error in question (the second time it gave me the error. I didn't have the wherewithal to expand the "Show details" at that time ).



When it crashed I described the same thing in the crash report. My computer's memory at the time was at 34% and of that ~5% was taken up by Pyxel.

Considering the size of sprites that I'm currently working on (including the effects for their attacks and what-have-you, necessitating large tile sizes, making really big canvases), this is a severe flaw for me.

This makes me want to question, is there any possibility of making Pyxel able to handle animations differently if necessary? I know that using the tile functionality to handle the animation in Pyxel is sort of integral to the program, and also kind of the big selling point, but it's simply not viable when you go beyond a certain size. I really like the workflow in Pyxel, but this is a limitation in Pyxels animation handling that I've been running into issues with for a while.

Comments

  • DanikDanik Posts: 639
    Adobe Air has a limit of around 1GB on the total memory that can be used by the program, and sadly I don't think there is any way around it. Very large canvases and many layers can make it go above that, and saving takes quite a bit of memory too when compressing the image data.

    I could add a way to save documents uncompressed to avoid the spike when compressing, but that would just help when saving. Maybe when running out of memory when saving a dialog box could ask if the user wants to save uncompressed instead, because I can imagine it's very frustrating not being able to save.

    I see you have rather many layers, so one thing you could do would be to try to keep the number down as much as possible since the memory used by the canvas is multiplied by that number.

    As you say optionally handling animations differently would probably help, for example a second mode for animations that keeps only the necessary frame data per animation frame and layer, but that would be a lot of work and make the program more complex. I will think about it and see if I can find another solution. 

    Sorry about the trouble this causes.
  • CandyFaceCandyFace Posts: 547
    edited May 13
    @Danik ;
    I assume that the memory limit is because AIR is 32bit? maybe you could provide a 64bit build too, although it's in beta, Adobe did release AIR 64 bit, a few months ago.
    Download Adobe AIR 25 Beta - Adobe Labs
  • inkBotinkBot Posts: 42
    @Danik Yeah, I have quite a few layers. I have my reasons for that, but you're right.

    Does the memory usage from saving count towards the inherent limit in AIR? I imagine it would, but I wouldn't actually know.

    I realize that I'm likely an outlier when it comes to what I'm using Pyxel for at this point, so I very much appreciate that you're so responsive to these topics. If a 64bit version of AIR would increase the memory limit this issue might be moot.
  • DanikDanik Posts: 639
    Thanks @CandyFace, I wasn't aware there was a 64 bit version for Windows in the works, hopefully it will help with the issue!

    @inkBot, yes, there is a memory spike when saving since the compression is pretty demanding.

    I will look into the possibility of making a 64 bit build when I get a chance.
  • I've had the same problem on a 32x32 image. So, less annoying, but if this program can barely handle this...
    ...then I don't know what else to say. :neutral: 
  • gautch Posts: 1
    Im getting an error as well

    Error #2038: File I/O Error.


    Error: Error #2038: File I/O Error.

    at pyx.io::PyxelSaver$/doWriteZipFile()

    at pyx.io::PyxelSaver$/saveDocument()

    at Function/<anonymous>()

    at Function/<anonymous>()


    Any ideas on what i can do?
  • dakoolkids Posts: 4
    Hi,
    same getting an annoying error crashing the app:

    Version 0.4.4 
    ArgumentError, Error #2015

    STACKTRACE
    ArgumentError: Error #2015
    at flash.display::BitmapData()
    at pyx.model::Layer()
    at pyx.model::Canvas/mergeLayers()
    at pyx.view.panels.layers::LayersPanel/mergeLayers_clicked()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.aswing::AbstractButton/__modelActionListener()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.aswing::DefaultButtonModel/fireActionEvent()
    at org.aswing::DefaultButtonModel/setPressed()
    at org.aswing::AbstractButton/__mouseReleaseListener()
    at flash.events::EventDispatcher/dispatchEvent()
    at org.aswing::AWSprite/__awStageMouseUpListener()

    RUNTIME INFO
    Platform: Windows 8
    Player: Desktop
    Version: WIN 18,0,0,161
    Screen size: 1920x1080
    Window size: 1936x1056
    Private memory: 1710.266 mb
    Total memory: 60.988 mb
    Time since start: 75.87s

    WORKSPACE STATUS
    Num documents: 1

    {
      "documents": {
        "0": {
          "numSwatches": 1380,
          "width": 2304,
          "height": 2400,
          "tileWidth": 2304,
          "tileHeight": 2400,
          "numLayers": 11,
          "undoSteps": 21,
          "tilesWide": 1,
          "tilesHigh": 1,
          "name": "1",
          "undoMemory": 0,
          "numberOfTiles": 1
        }
      }
    }

    and when saving:
    Error #1000: The system is out of memory.

    Error: Error #1000: The system is out of memory.
    at com.adobe.images::PNGEncoder$/encode()
    at pyx.io::PyxelSaver$/saveDocument()
    at Function/<anonymous>()
    at Function/<anonymous>()


    what to do??? i cant work like that - restarting every 5min
  • CandyFaceCandyFace Posts: 547
    edited July 13
    Hi dakoolkids, try to delete the PyxelEdit folder here:

    Windows: C:\Users\[username]\AppData\Roaming\PyxelEdit or similar.
    You can enter %appdata% as the path in windows explorer to find the Roaming folder quickly.
    Mac: /Users/[username]/Library/Application Support/PyxelEdit or similar.


  • dakoolkids Posts: 4
    thanks, ill try
  • dakoolkids Posts: 4
    it still crash...

    Version 0.4.4 
    ArgumentError, Error #2015

    STACKTRACE
    ArgumentError: Error #2015
    at flash.display::BitmapData()
    at pyx.util::Util$/shiftBitmapData()
    at pyx.tools::NudgeTool/moveTo()
    at pyx::ToolHandler/moveCurrentToolTo()
    at pyx.view.document::CanvasToolArea/pointerMove()
    at pyx.view.document::CanvasToolArea/mouseMove()

    RUNTIME INFO
    Platform: Windows 8
    Player: Desktop
    Version: WIN 18,0,0,161
    Screen size: 1920x1080
    Window size: 1936x1056
    Private memory: 1618.523 mb
    Total memory: 37.164 mb
    Time since start: 192.71s

    WORKSPACE STATUS
    Num documents: 1

    {
      "documents": {
        "0": {
          "undoMemory": 0,
          "width": 2304,
          "height": 2400,
          "tilesHigh": 1,
          "numberOfTiles": 1,
          "undoSteps": 38,
          "numSwatches": 1380,
          "tileWidth": 2304,
          "tileHeight": 2400,
          "name": "1",
          "numLayers": 24,
          "tilesWide": 1
        }
      }
    }
  • CandyFaceCandyFace Posts: 547
    Sorry to hear that, would you mind uploading the .pyxel file to let me or @Danik check it out?
  • dakoolkids Posts: 4
    yep for sure, do you have an email?
    it looks like pyxeledit is taking a huge amount of memory....
  • CandyFaceCandyFace Posts: 547
    edited July 14
    I've taken a look at your file, you have a lot of swatches and layers, that plus the size of the canvas will consume a lot of memory, it doesn't crash for me though, but that might be because i'm on OS X and not memory restricted.

    If you're on Windows, that might explain the crash. The 32 Bit version of Adobe Air (the framework which PyxelEdit is written in) only allows 2GB of memory to be used for now.

    Alright so there are a few things you can do to lessen the memory usage. Work in the native size of the canvas (768x800 or something), it looks upscaled in the size you gave me.

    Cut down on the amount of swatches, you currently have 1380. Use the powerful shading panel found in the color window instead and keep only a relatively small amount of swatches in the panel.

    Setup your canvas so it consists of tiles and use the tiles feature instead of a lot of layers. 
Sign In or Register to comment.