playMaker

Author Topic: Memory problems  (Read 2675 times)

JennaReanne

  • Junior Playmaker
  • **
  • Posts: 57
    • Little Worlds Interactive
Memory problems
« on: September 24, 2014, 10:37:36 AM »
Hello - I'm working hard to optimize my game for mobile (I don't think this issue is mobile-specific, but I can re-post in the iOS forum if that's more appropriate).  I'm seeing some weird behavior with the textures that get loaded into memory (I'm seeing this by using the iOS profiler).  In any given scene, I'm seeing every texture loaded into memory that could possibly be used in that scene.  It appears that on loading the scene the game is going through every FSM and loading assets from every prefab that could possibly ever be instantiated into the scene.

For example, if I have a scene with prefab A, which has an FSM that loads prefab B on click, when the scene first loads I will have textures from both prefab A and prefab B already loaded into memory.

This is obviously a huge problem, and my game is using way more memory than it should.  What is going on here and how do I fix it?

Thank you,
Jenna

JennaReanne

  • Junior Playmaker
  • **
  • Posts: 57
    • Little Worlds Interactive
Re: Memory problems
« Reply #1 on: September 29, 2014, 09:54:51 AM »
Please ignore this thread, after many discussions with programmer buddies I've learned that this is actually something Unity does.