Ran out of chunks of size 16

JamesBoucherJamesBoucher Member Posts: 433
What does this mean "Ran out of chunks of size 16". I get this about thirty seconds into the game.
«1

Comments

  • PatronusPatronus Member Posts: 56
    Do you have a number of actors on screen using the drag function? I had a similar problem and it was finally traced to a problem with the drag attribute. It will make the game crash after a while.
  • JamesBoucherJamesBoucher Member Posts: 433
    No drag. I us accelerate, rotate, collide, destroy, timers, and spawn. Have I reached a memory limit?
  • PatronusPatronus Member Posts: 56
    I guess it is possible if you keep spawning actors without destroying old ones. But surely then some other GS users would have experienced the same problem by now?
  • JamesBoucherJamesBoucher Member Posts: 433
    I spawn new actors up to 30. I destroy actors on collision.
  • JamesBoucherJamesBoucher Member Posts: 433
    Is there a limit on the number of actors you can spawn? When I destroy the actors does this release the actors from memory? Any help would be great.
  • butterbeanbutterbean Member Posts: 4,315
    I don't think there's any one answer for this, I think it depends on the size of your actor you're spawning.

    As far as I know, destroying an actor once it leaves the screen does help with performance, and that's what I'm doing with all my games.

    I have a game for example that spawns creatures every few seconds, and then I destroy them once they leave the screen, I've had 30 actors on screen at once, but then again, these actors were small in memory, hope this helps!
  • JamesBoucherJamesBoucher Member Posts: 433
    The actor that I spawn are 8, 16, and 32. If I'm always destroying them (on collision) then what's causing the memory leak?
  • JamesBoucherJamesBoucher Member Posts: 433
    If this help...this is whats in the debugger console when my game locks up. I'm running this in the simulator because I get an error when trying to publish to my device.

    [Session started at 2009-12-01 21:55:27 -0500.]

    [Session started at 2009-12-01 21:56:41 -0500.]
    Ran out of chunks of size 16
    GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:11:58 UTC 2009)
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB. Type "show warranty" for details.
    This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all
    Attaching to process 489.
    Xcode could not locate source file: cpu_capabilities.h (line: 246)
    Xcode could not locate source file: cpu_capabilities.h (line: 246)
    Current language: auto; currently asm
    Xcode could not locate source file: cpu_capabilities.h (line: 246)
    (gdb)
  • JamesBoucherJamesBoucher Member Posts: 433
    Made some changes but I still get the error. When I start the game the Game Engine and Other memory keeps going up then about 20 second into the game it stops. and I get the following.

    [Session started at 2009-12-02 20:15:15 -0500.]
    Ran out of chunks of size 16
    GNU gdb 6.3.50-20050815 (Apple version gdb-967) (Tue Jul 14 02:11:58 UTC 2009)
    Copyright 2004 Free Software Foundation, Inc.
    GDB is free software, covered by the GNU General Public License, and you are
    welcome to change it and/or distribute copies of it under certain conditions.
    Type "show copying" to see the conditions.
    There is absolutely no warranty for GDB. Type "show warranty" for details.
    This GDB was configured as "i386-apple-darwin".sharedlibrary apply-load-rules all
    Attaching to process 4698.
    Xcode could not locate source file: cpu_capabilities.h (line: 246)
    (gdb)
  • JamesBoucherJamesBoucher Member Posts: 433
    Not have any luck finding why my game freezes 20 seconds into play. I create no new actors during this time. Could it be something with timers. I'm use to having access to the code so I can figure out what's going on. How do you debug something you can't access?

    Once again the memory used keeps going up and I'm not introducing and new actors. I do have several actors (10-12) moving around.

    Any help on how to go about debugging this would be great...
  • JamesBoucherJamesBoucher Member Posts: 433
    I run Instruments against my app and I can see a memory leak when GS first starts. This is the only memory leak that I see. ObjectAlloc goes way up but then seems to hold steady. The GeneralBlock-16 is real bad and so is the GeneralBlock-64. I can see that 70% of the GeneralBlock-16 is taken up by Thread_star. This is why on the previous post I askedif could it be a timer problem. I've saved the Instruments run if GS would like me to send it to them. I only ran it against Leaks and ObjectAlloc. I do not know what else I can do without some sort of assistance from GS.
  • JamesBoucherJamesBoucher Member Posts: 433
    Hello...Anybody out there..Hello. I'm I just SOL?
  • JamesBoucherJamesBoucher Member Posts: 433
    Going on three days and still not response. Tomorrow will be one week since i purchased GS and I'm no closer to getting my app to the market. The first four days nothing worked and the last three days I can't even get a response from GS.

    I've supplied all that I could concerning my app freezing and can't go any further. It does me no good to create an app if I can't get it to the market.
  • JamesBoucherJamesBoucher Member Posts: 433
    I'm going to keep asking until I get an answer.
  • butterbeanbutterbean Member Posts: 4,315
    I haven't run error tests before on any game, I just test it
    on the viewer and go by the framerates, so I wouldn't be able
    to help you, have you upgraded
    to the latest version of GS? I noticed some improvement in my platformer game
    I think for now, spawning will still take up a ton of memory depending on the size of your images
    I have birds being spawned that are very small in size, like maybe no more than 16kb
    for each image
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    if you want to post your game and the sourcecode online I'll take a look. it's extremely difficult to toubleshoot code without seeing it.
  • JamesBoucherJamesBoucher Member Posts: 433
    I'm at work right now(That right some of us have jobs). I will post it later when I get home.
  • JamesBoucherJamesBoucher Member Posts: 433
    OK mulcahy it's posted. Sorry it took so long but had problems uploading game. The publish to the GS server would freeze. If you have any problems let me know.
  • JamesBoucherJamesBoucher Member Posts: 433
    FYI (mulcahy) all ten levels work with the arrow keys and the space bar. Only the first level works with the on screen buttons. I'm still deciding if I want to use on screen button or something else to control the tank.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    Does it happen on a particular level? Does it happen every single time in the same place? I downloaded your project and took a quick look, I won't have a big block of time until the morning.

    I played level 1 for a few minutes without seeing that error.

    Could you list in detail what you're doing to reproduce the problem? Be very detailed, starting from the main menu.
    i.e.
    click start
    click tank: green
    click lives: 1
    click ammo: fireball
    click play

    something like that, it'll help a bunch. Also, post your machine specs:

    Machine: (i.e. macbook, imac)
    Processor:
    RAM:
    OS X Version:
    Gamesalad Version:
  • JamesBoucherJamesBoucher Member Posts: 433
    I have no problem running the app on the mac. The problem only happens on the iPhone device or simulator. Start level one and do nothing. About 20-30 seconds it will freeze.

    It's a Mac mini. This should not matter since it's being downloaded to an iPod touch.
    GS version is 6.2 and viewer is 6.1. The latest.
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
  • jonmulcahyjonmulcahy Member, Sous Chef Posts: 10,408
    well, something looks very wrong with your project, I just did a quick comparison between your project and mine:

    V is for Vortex:
    90 Actors
    0 Behaviors
    77 images
    25 scenes
    10 sounds

    Rats of the Maze:
    90 actors
    0 behaviors
    94 images
    17 scenes
    6 sounds

    When I load my game to the title screen, the stats in gamesalad are:
    Images: 3.0MB
    Sounds: 0KB
    Game Engine: 8.1MB
    Other: 5.2MB
    Total: 16.3MB

    When I load rats of the maze up:
    Images: 512KB
    Sounds: 0KB
    Game Engine: 8.3MB
    Other: 36.2MB!!!
    Total: 45MB

    as soon as level one loads up, your game engine goes to 18, and Other goes up to 44.4, giving a total memory of 65, once it hits 66 or 67 it crashes.

    For kicks I went into your level 1 and remove all your 'Wall Objects', I thought that maybe there were too many of them. It helped bring the game engine back down to about 10 or 11, but Other was still over 40.

    I also tried removing all of the images & sounds incase one of those was bad, but same thing happened.

    Anyone from the GameSalad team knows what's counted towards that "Other" number? I've got an iPhone 3GS, so I was able to play for a minute before it actually crashed. It's strange to me that it would be so high on the very first scene, which only displays an image.

    I've got to run some errands, but I'll take another look later today.
  • JamesBoucherJamesBoucher Member Posts: 433
    You have did what I did. I also ran instruments and have posted that. I have posted the console message and the debug messages. The problem is I can't get anyone from GS to respond. I have also started removing parts to see if I can find what's causing it to freeze. I've been a developer for over 25 years, and I'm sure I could figure it out if I had the code.
  • superNESsuperNES Member Posts: 166
    Hi James. I'm sorry for the delay. I played the game but did not experience a crash - however I did see very low performance as well as high usage of the Game Engine which could be causing your crash. I'll forward this to our support team and see if they have any insight.

    However, in my own inspection, I found the sheer amount of walls and the amount of behaviors within each of the walls is causing a huge performance hit in the engine. You have nearly 50 wall pieces, each asking itself on each frame whether the level has changed or not. Keep in mind that the iPhone is going to have performance limitations, so you'll need to be creative on how you setup your scenes.

    One suggestion is to try making a single image for your level (in an outside image editor), with the walls as white blocks and the everything else as transparent. Instead of having each single wall segment evaluating what color it should be each cpu update, just do it for that one image. Then drop in some invisible walls (uncheck the "Visible" toggle in the actor attributes>graphics) and align them with the image to create the collision blocks, and you've accomplished the same thing with 1/50 less behaviors.
  • JamesBoucherJamesBoucher Member Posts: 433
    I will make the changes later today. Thanks.
  • dandan Inactive, Chef Emeritus Posts: 28
    The original 'ran out of chunks of size 16' error is being caused by an issue in the GameSalad engine's memory allocator. We are looking at this right now.

    I also see some other issues mentioned in this thread, so here is some more detailed information:

    We've found that if a game's memory usage gets above 50-60Mb total, it start to have a high chance of 'crashing' on iPhone. This crash is actually the iPhone OS terminating the game's process because it has requested too much memory.

    Another thing that can cause termination on iPhone is if the memory usage grows too quickly in too short of a time span. e.x. You change from a scene with low memory consumption immediately to a scene with extremely high memory consumption. Gradual growth is safer than sharp growth. This is a behavior of the current iPhone OS.
  • JamesBoucherJamesBoucher Member Posts: 433
    I did what superNES suggested. I created a single image then added invisible walls so no color checking to change the walls colors takes place. Same result. It crashes about 30 seconds into game.
  • JamesBoucherJamesBoucher Member Posts: 433
    Dan, how do you keep your app from getting over 50mb? How do you keep the game from jumping up quickly?
  • JamesBoucherJamesBoucher Member Posts: 433
    I still think the problem has to do with timers being built but not being destroyed in the XCode. I'm going to start over and build one level that I can play without any errors. I will make this the hardest level so I can test to see what is the limit for GS.
Sign In or Register to comment.