QField icon indicating copy to clipboard operation
QField copied to clipboard

Small memory-leak causes QField-crash (and loss of currently digitzed feature)

Open koenigherford opened this issue 1 year ago • 4 comments

Describe the issue

When digitizing with a complex qgis/qfield-project (lots of fields, constraints, default values, and photo-attachements) sometimes QField crashes when adding a photo-attachment after pressing the "ok" button in the camera-mode.

This only happens after a lager bunch of collected features. But it happens sometimes a day collecting data. Once there was something like a "cache-overflow"-warning, but mostly the notice was as screenshot below.

After that it seems you have to start QField and the procect again and have to digitize the (lost) feature again -which will cause a new crash when adding a photo-attachement.

After that it seems you have to open the project again and manually close it by using "<" button.

After starting QField and the project again and collecting the feature again (with same attributes and taking a picture as before) everything will work for some hours again. So it seems not to be a reason inside the project configuration itself.

Sample-project-download-link (no cloud-project) can be provided outside this platform if you like

grafik

Desktop (please complete the following information)

  • OS: Windows
  • QGIS Version [e.g. 3.36.0]
  • QFieldSync Version [4.9.1]

Mobile (please complete the following information)

  • Device: [Galaxy Tab Active3]
  • OS: [Android 13, OneUI 5.1.1]
  • QField version: [3.2.2 - 72be17 v3.2.2 QT 6.6.2]

koenigherford avatar Apr 17 '24 12:04 koenigherford

Thanks for reporting @koenigherford This sounds similar to https://github.com/opengisch/QField/issues/1671

Are you using the native camera or not?

For reference: we were in touch with Samsung and when using the native camera in combination with some memory heavy project (in the case there it was connected to a pattern fill symbology, but it's not restricted to that), when starting the camera, the Android system was closing QField to free memory for the camera. In this case it's out of our hands, as Android reserves the rights to close any app at any time, the controllable solutions were: using the builtin camera, more memory, more memoryfriendly project.

m-kuhn avatar Apr 23 '24 06:04 m-kuhn

"Use Native camera" was enabled by QField by default. Disabled it and installed "Open Camera App" as recommended. Will make a test in the field.

koenigherford avatar Apr 23 '24 06:04 koenigherford

You don't need "Open Camera App" any more, this is purely QField functionality. Is Open Camera still documented somewhere?

m-kuhn avatar Apr 23 '24 06:04 m-kuhn

Yes... grafik

koenigherford avatar Apr 23 '24 06:04 koenigherford

Issue can be avoided by disabeling "use native camera" as described above

koenigherford avatar May 02 '24 11:05 koenigherford

Thanks for checking, I think we should switch the default then ...

@nirvn thoughts?

m-kuhn avatar May 02 '24 11:05 m-kuhn

Yes... grafik

@SeqLaz IIRC you planned to adjust this documentation (and remove the reference to open camera) did you get to it?

m-kuhn avatar May 02 '24 11:05 m-kuhn

@m-kuhn I will add it to the documentation, but no, I did not started yet

SeqLaz avatar May 02 '24 12:05 SeqLaz