question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

If device is out of memory, plugin start service automatic

See original GitHub issue

Your Environment

  • Plugin version: Alpha 50
  • Platform: Android
  • OS version: 8.0.0
  • Device manufacturer and model: Any
  • Running in Simulator: Yes, same issue
  • Cordova version (cordova -v): 8.1.2
  • Cordova platform version (cordova platform ls): Android and iOS
  • Plugin configuration options: doesn’t matter, happens all time
  • Link to your project:

Context

So… if your App is startet, and these plugin is loaded (and configurated) - just minimize the app, and run the device out of memory (with a lot of apps, or with the Fill RAM memory app) within 60 secounds after minimize, and the plugin starts a LocationService automatic - u cant stop it!

If u wait longer thant 60 seconds the background service will stop by os or plugin and don’t start automatic.

I think the problem is, that if u call stop() - the attempt the serice to kill, but dont do it immediately. It will be killed after 60 seconds.

The central issue is, that u cant do anything. The device track the location all time, untill u kill the app in taskmanager.

Expected Behavior

LocationService should stop immediately after calling stop().

Actual Behavior

The LocationService runs 60 secs longer. If the app got killed caus device is out of memory, the LocationService start and dont stop to track.

Possible Fix

Kill Service immediately

Steps to Reproduce

  1. Start App and configurate Plugin
  2. Minimize the App
  3. Run device out of memory in 60 seconds
  4. It starts tracking automatic

Context

I cant use these plugin, caus no one wants a app whos tracking u all time. I tried tausends of configurations, tried to do something on “resume ore pause” events on Corodva, but the dont trigger on out of memory. I tried to call stop() at every event from the Plugin, but it dont stops after automatic restart…

Debug logs

This is what happend after killed within 60 secs:

I/com.marianhello.bgloc.service.LocationServiceImpl: Creating LocationServiceImpl I/com.marianhello.bgloc.PostLocationTask: Creating PostLocationTask W/com.marianhello.bgloc.service.LocationServiceImpl: Attempt to start unconfigured service. Will use stored or default. I/com.marianhello.bgloc.service.LocationServiceImpl: Network condition changed has connectivity: true D/com.marianhello.bgloc.service.LocationServiceImpl: Will start service with: Config[distanceFilter=3 stationaryRadius=3.0 desiredAccuracy=0 interval=10000 fastestInterval=120000 activitiesInterval=10000 isDebugging=false stopOnTerminate=true stopOnStillActivity=true startOnBoot=false startForeground=true notificationsEnabled=false locationProvider=0 nTitle=Background tracking nText=ENABLED nIconLarge= nIconSmall= nIconColor= url=https://[HIDE] syncUrl= syncThreshold=100 httpHeaders={} maxLocations=10000 postTemplate={“acc”:“@accuracy”,“alt”:“@altitude”,“lon”:“@longitude”,“lat”:“@latitude”,“speed”:“@speed”}] I/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: Creating DistanceFilterLocationProvider I/com.tenforwardconsulting.bgloc.DistanceFilterLocationProvider: Start recording

Than i goes the normal tracking way…

Hopy anyone has an idea. But i love these plugin!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:15 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
papattescommented, Feb 12, 2019

@mauron85 all our hopes rest on you! : D

0reactions
mauron85commented, Mar 25, 2019

Should be fixed in v3.0.0.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Service Host applications EATING up Memory
Go to Start -> Settings -> Update & security, then Check for updates and install any available updates. Other things you can also...
Read more >
How to fix out of memory errors by increasing available memory
Go to Start >> Run , and run "regedit32.exe" · Find the Services entry: · To change existing properties, especially increasing Xmx memory,...
Read more >
NET Out Of Memory Exception - Used 1.3GB but have 16GB ...
Being set to AnyCPU, on a 64bit OS with 16gb of RAM can still hit an out of memory exception at 2gb if...
Read more >
How To Fix Windows 10 Memory Leaks - Online Tech Tips
A Windows 10 memory leak occurs when an app you were using didn't return the resources to your system when you finished using...
Read more >
Here are the ways to fix 'Google Chrome Is Out of Memory' error
1. Restart your device. 2. Update Google Chrome. 3. Clear the browser's cache.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found