Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
Memory optimization — Gideros Forum

Memory optimization

freesspfreessp Member
edited November 2014 in Game & application design
As any good programmer knows, memory (RAM) is very limited on mobile devices, especially on older and lower-end devices. To deal with this issue, we must be sure to remove anything from memory as soon as we no longer need it (i.e. large textures and event handlers). As most of us also know, not all app developers, even those from major companies, do a good job of this. That is why our devices start performing very slowly and erratically and make us want to throw them against the wall.

I, personally, use an app on my phone that provides a "Memory Boost" option that frees up RAM. If my device is performing poorly, I just run the app to free up the memory and everything is back to normal (just regular slow instead of super-duper-slow).

So my question/suggestion is, wouldn't it be a good idea to put code in the beginning of all of our apps that would perform this "memory boost" before our apps run (during startup)? That way, our apps would be allowed to perform at their very best every time they are opened. Does anyone know how these "memory booster" apps work or how similar code could be written in Lua/Gideros? What do you guys think?

Comments

  • While its a tempting idea, I don't think it would be good for an app to do this unless that is its function. The memory cache also allows for quick access to prior apps and putting it at the start of a game could cause more unintentional harm than good.

    I doubt you could do it in lua, would have to be a native code.

    I'm curious, what app and os are you running? Is your phone rooted?
  • I guess my question was more rhetorical than practical. I already knew that lua would not be capable of such things if I would have taken the time to think about it for a second.

    The fact that the memory cache holds info for previously used apps, often for no other reason than slightly faster, future load time, is kind of what I was getting at. I try to make sure all elements of my apps are removed from memory to avoid leaks and slow downs, so why doesn't everybody do the same? (Again, a rhetorical question since I am about to answer it myself).

    I do know that as devices get faster processors, larger memory, larger storage capacity, etc., efficiency becomes less important. I watched the same thing happen with computers. For example, the word processor I use now, that is hundreds of megabytes in size, doesn't really do a whole lot more than the one I used in the (late) '80s that could be ran from a 720kB floppy. Newer computers can have hundreds of unnecessary processes running in the background without being noticeable, while older systems will become so slow they are unusable (referring to Windows systems).

    With all of this said, I am basically referring to building apps for older, slower phones. I am starting to realize, however, that trying to make my apps run on these older phones may be counter-productive. While, in theory, it will make my apps available to the widest user base, it also forces me to "dumb-down" my apps which may cause me to lose customers who want to use the full potential of their high-end devices.

    I am also referring exclusively to Android devices. I am not a fan of that other company's business practices. To answer EricCarr's last question, my phone is not rooted.
  • Yep, developing for iOS requires a greater initial investment in both $$$ and time, but the reality is iOS users are more likely to purchase your app. Although Google Play downloads exceed the App Store by 25%, the App Store earns 50% more in revenue.

    No doubt development for Apple is more strict, but if you plan to earn a living doing this stuff, it's pretty clear at this point that iOS users should be your primary target audience.
    zoha
  • There is loads of memory on mobile devices - you should have grown up in the 80's with between 1k and 16k of ram!
    Coder, video game industry veteran (since the '80s, ❤'s assembler), arrested - never convicted hacker (in the '90s), dad of five, he/him (if that even matters!).
    https://deluxepixel.com
  • :)

    Likes: SinisterSoft

    WhiteTree Games - Home, home on the web, where the bits and bytes they do play!
    #MakeABetterGame! "Never give up, Never NEVER give up!" - Winston Churchill
    +1 -1 (+1 / -0 )Share on Facebook
  • Ha ha, great video! My first computer was a TRS-80 Color Computer 2. 64K of ram, no hard drive, used a TV as a monitor. You could hook up a standard cassette recorder to use as storage. I did have a 5 1/4 inch floppy drive that connected to the side through a gigantic cartridge though, which was a rather expensive add-on. I was around 11 or 12 years old and learned everything I could about the BASIC programming language. I even wrote a pretty neat side-scrolling platformer, but it was way to slow to function properly, probably because at that age I had no idea what a compiler was. What's funny is, I am currently working on a similar game using Gideros. Back then I had to plot graphics on graph paper, program the coordinates one visual line at a time, then move each and every line individually for motion. Things are so much easier now, except as an adult I have much more self doubt and fear about showing my creations to others. Funny how things work.

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
Sign In or Register to comment.