Changes to variables during menu/ask navigation

I have been experiencing something strange lately and wanted to know if anyone else has as well, and if any experiences you may have, may help me/us pin down what has changed.

I have a lot of variables: to the point where I was getting out of memory crashes when playing on the system (not in the simulator, that thing can handle a lot more variables.) Since there is no garbage collection, I have come up with a system of certain variables being reused for all sorts of purposes. This makes it so I have to be careful to make sure two different things are not using the same variable at the same time, but that’s just how it is. I have found that when I was using menus (including both the menu command and the ask command) that the code for the menus and the sub menus would all operate without anything else in the game running code (note how all animations stop etc when a menu is open.) This allowed me to pretty freely use temporary variables for the normal game loop and the draw function in menus. This has been working well for a long time. Somewhat recently, this has stopped working when playing the game on the console (the simulator’s behavior has not changed.) Moving around a menu–such as going into submenu, pressing B to back out and then going into a submenu again–will cause some of these variables that are used in other places to not retain their value while in the menus.

It has become impossible to debug and test for because:

  1. this happens on the console only so we cannot use log

  2. these are variables that were once protected from the rest of the game so the issue could be ANYWHERE

  3. this is something I use a lot so it’s going to be a huge task to track down where it happens

Has anyone noticed anything like this suddenly happening?