This is a migrated thread and some comments may be shown as answers.

Out of Memory Error

1 Answer 50 Views
Report a bug
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Tim
Top achievements
Rank 1
Tim asked on 03 Jul 2016, 06:46 AM

I received this one today, while testing my app via livesync. I have seen it a couple of times over the last month or so:

"Out of Memory Error"  along with "No Stack available" message. 

I am developing in Platform using an in-browser client and livesync testing on Android and iOS tablets.

Our app uses a lot of images, but I still don't expect this to occur. Is there any way to increase heap/stack allocation for NativeScript apps built using Platform?

 

Cheers

Tim

 

1 Answer, 1 is accepted

Sort by
0
Nick Iliev
Telerik team
answered on 06 Jul 2016, 09:02 AM
Hi Tim,

The reasons behind "Out of memory" error can be different so in order to reproduce it the best way is to have a sample project which is throwing that error. Of course, I understand that sometimes sending projects is not an option (due to privacy or other reasons) so another way to provide us with more information is to log this error.
There are several approaches.
1.) Use the application events and specifically the lowMemoryEvent

in your app.js
var application = require("application");

application.on(application.lowMemoryEvent,
function (args) {
    if (args.android) {
        // For Android applications, args.android is an android activity class.
        console.log("Activity: " + args.android);
    } else if (args.ios) {
        // For iOS applications, args.ios is UIApplication.
        console.log("UIApplication: " + args.ios);
    }
});
More about application events here.

This way you can log additional information about what is causing the memory leak.
More about logging in Telerik Platform via in-Browser here: http://docs.telerik.com/platform/appbuilder/nativescript/debugging-your-code/view-logs


Regards,
Nikolay Iliev
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Report a bug
Asked by
Tim
Top achievements
Rank 1
Answers by
Nick Iliev
Telerik team
Share this question
or