•   over 11 years ago

Help request: occasionally lowmem_oom_killer_cb kills application on launch.

Hiya,

I posted this in the general Samsung SDK forums already but as it is my last remaining bug to crush, I thought I'd get more eyes on this as it is quite a serious one. You would have a huge debt of gratitude from my for any help with this! As it is my last bug and I know everyone is busy with their submissions, I'd even be willing to pay $50 via Paypal to the first person to publicly post a definitive solution that completely solves the issue (beyond unpractical/obvious stuff like "reduce your application's memory footprint so Tizen will kill other applications first") if they want the monetary incentive . Note: This does mean I recently found a way to induce the state below to test against... just haven't yet found a way to handle it.

The general issue: I had noticed this in the past but the following has become more frequent as my Tizen Wear application has grown in functionality. The condition of this problem is the following:

Watch has been running for some time and my application is not running at all. It attempts to start my application... but ends up killing it immediately to free up memory.

Please note that upon a restart of the device, my application will run completely fine and without any issues. It doesn't appear to be a memory leak on my end as using the application for hours straight won't cause an issue. It is only that after the opening and closing of many applications on the device that when one goes to start mine, the watch kills it upon launch for some reason. I have never ever seen it kill my application once is it actually running. I included a log of this in the Samsung SDK forums.

Any advice would be greatly appreciated on how to best handle this. I can't find much documentation on how Tizen's memory management works and there are no references in the SDK docs that I can locate on how to interact with it.

Thank you!

  • 4 comments

  •   •   over 11 years ago

    What about creating alternative entry point for your app, i.e. lowmemstart.html with minimal javascript, etc. and then "redirect" to main app issuing:
    window.location.href='index.html';
    ?

    It should help you diagnose the problem.

  •   •   over 11 years ago

    @dunqan - doesn't help as it isn't a memory leak.

    The recent SDK update has notes that they added an interface to detect memory on the device, see: https://developer.tizen.org/downloads/sdk/release-notes/tizen-sdk-wearable-1.0.0b3 . It even now exists in the official SystemInfo documentation as a listed property in the SDK Help. But it doesn't actually work and just throws an error unlike any of the other valid options. :(

    Tizen's low memory manager is (most likely) badly coded. There doesn't seem to be a way to resolve it beyond just not being the application taking up the most amount of memory when it goes to clear some as it won't distinguish which one the user is trying to actually start up.

    Anyway - have a theory on how to maybe work around it. Hopefully will work out...

  •   •   over 11 years ago

    "doesn't help as it isn't a memory leak."

    It's doesn't matter if it's memory leak or not.
    If your app gets killed on launch, you can create lomemstart.html with simple button "Start" with onclick event setting "window.location.href='index.html';".

    After that, if lowmemstart.html is launching correctly (without killing app) it's half of the success. You can then check, if app starts sucessfully by clicking start button (success), and if not, you can debug code step by step, etc.

    It's not comlpete solution, it can't be without your soruce code, but It's the good way to get it working.

    Happy coding ;-)

  •   •   over 11 years ago

    @dunqan - I appreciate the advice. :) Anyway - posted my final findings in the developer forums. The only solution was to take my single TextureAtlas and split it into many of them (which means a ton of image duplication in each atlas). Then dynamically switch those out depending on the application current section (which means huge slowdown at points).

    Seems to avoid being the application killed by lowmem_oom_killer_cb now but still will need to test it more. In essence, there is an artificial memory limit of applications on Tizen Wearable of somewhere between 5 and 10 MB of RAM usage.

Comments are closed.