delashum / obsidian-checklist-plugin

MIT License
401 stars 43 forks source link

Android obsidian freezes and crash due to OOM when tag name is empty #193

Open Accelsnow opened 6 months ago

Accelsnow commented 6 months ago

Steps to reproduce

  1. install plugin
  2. remove all tag filters in plugin settings (query-all-file mode)
  3. start android obsidian
  4. Android obsidian becomes extremely laggy, freezes and eventually crashes

Note: this only happens on my Android obsidian app. On the PC obsidian it works as-intended. Note 2: This is a stably reproducible problem on my phone


Expected Result


Actual Result


My obsidian setup

Android obsidian version 1.5.12(134)

Plugin list (I have many plugins, but they worked fine)

attachment-flow-plugin
better-export-pdf
better-word-count
calendar
cm-editor-syntax-highlight-obsidian
cmdr
colored-tags
convert-url-to-iframe
dataview
dbfolder
editing-toolbar
file-explorer-note-count
file-explorer-plus
floating-toc
folder-notes
google-calendar
highlightr-plugin
media-extended
multi-properties
obsidian-advanced-uri
obsidian-annotator
obsidian-checklist-plugin
obsidian-excalidraw-plugin
obsidian-excel-plus-1.1.0
obsidian-folder-focus-mode
obsidian-front-matter-title-plugin
obsidian-hider
obsidian-hover-editor
obsidian-kanban
obsidian-link-converter
obsidian-minimal-settings
obsidian-outliner
obsidian-pretty-bibtex
obsidian-style-settings
obsidian-tasks-plugin
obsidian42-brat
omnisearch
quick-latex
quickadd
recent-files-obsidian
slash-commander
tag-wrangler
templater-obsidian
text-extractor
waypoint

My hardware and OS

Sony Xperia 1V Android 14 12GB RAM


Related issues

Found some potentially related issues

188 #183


JS console logs

JS Console Logs with checklist plugin in empty tag filter config (freeze and crash):

The error messages here are common. They appear with/without checklist plugin and does not affect normal functionality (I included screenshot of the console log when obsidian is working normally as comparison below)

image

JS Memory dump with stacktrace

I tried to use Chrome's inspection tool to run a memory trace on Obsidian. I first started obsidian with some tags in the filter, which works fine. I connected the memory trace collector and then deleted all tags. App immediately freezes with one large memory allocation spike (program freezes afterwards with Android's GC repeatedly reporting OOM). I checked the mem snapshot and traces and got the following clues:

Clue 1

For the only allocation spike that took place immediately before the freeze, it seems like checklist allocated a huge string object with some PNG heading, but the content seems to be scrambled or in some binary format, which seems unusual.

image

Clue 2

I think this is where I made some discoveries. The owner of this string is an Object allocated by checklist as its content. It seems like it's pointing to one of the PNG file in my vault (size 487KB). This doesn't quite feel right as there's no task in a PNG file, and I think checklist shouldn't really need to load a PNG file. I checked the rest of the objects, it looks like it's loading everything in my vault into memory (canvas files, png files, etc.) I guess this is very inefficient, and can potentially cause my OOM. However, my entire vault is only around 150 MB, even if all files are loaded it shouldn't really go all the way to OOM. There might be some other factors here.

image

JS Console Logs with checklist plugin in non-empty tag filter config (works normally):

The main difference between the two is that, with empty tag filter, since the OOM happens fairly quickly, many plugins are unable to load due to exhausted memory (for example, omnisearch failed to load in empty-tag config but loaded with no problem in with-tag config)

image


Android Logcat Traces

With empty-tag checklist plugin config, the follow log shows:

2024-05-16 00:24:20.077  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 379MB to 368MB
2024-05-16 00:24:20.321  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:20.325  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:20.342  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 20.683ms
2024-05-16 00:24:20.342  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:20.342  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 17.137ms
2024-05-16 00:24:20.342  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:20.830  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:20.832  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:20.849  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 388MB to 368MB
2024-05-16 00:24:20.849  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 18.401ms
2024-05-16 00:24:20.849  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:20.849  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 16.634ms
2024-05-16 00:24:20.849  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:21.075  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:21.093  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 388MB to 368MB
2024-05-16 00:24:21.093  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 17.999ms
2024-05-16 00:24:21.093  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:21.327  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:21.331  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:21.346  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 388MB to 368MB
2024-05-16 00:24:21.346  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 18.862ms
2024-05-16 00:24:21.346  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:21.346  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 15.190ms
2024-05-16 00:24:21.346  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:21.579  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:21.602  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 388MB to 368MB
2024-05-16 00:24:21.602  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 23.101ms
2024-05-16 00:24:21.602  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:21.839  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:21.839  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:21.857  9492-9577  md.obsidian          md.obsidian                     I  Clamp target GC heap from 388MB to 368MB
2024-05-16 00:24:21.857  9492-9577  md.obsidian          md.obsidian                     I  Alloc concurrent mark compact GC freed 6865198(171MB) AllocSpace objects, 0(0B) LOS objects, 46% free, 196MB/368MB, paused 71us,931us total 18.545ms
2024-05-16 00:24:21.857  9492-9503  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Background on Alloc for 18.613ms
2024-05-16 00:24:21.926  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:21.926  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:21.936  9492-9577  md.obsidian          md.obsidian                     I  Clamp target GC heap from 388MB to 368MB
2024-05-16 00:24:21.936  9492-9577  md.obsidian          md.obsidian                     I  Alloc concurrent mark compact GC freed 2019950(50MB) AllocSpace objects, 0(0B) LOS objects, 46% free, 196MB/368MB, paused 64us,639us total 9.170ms
2024-05-16 00:24:21.936  9492-9577  md.obsidian          md.obsidian                     I  Forcing collection of SoftReferences for 144MB allocation
2024-05-16 00:24:21.936  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:21.941  9492-9577  md.obsidian          md.obsidian                     I  Clamp target GC heap from 388MB to 368MB
2024-05-16 00:24:21.947  9492-9577  md.obsidian          md.obsidian                     W  Throwing OutOfMemoryError "Failed to allocate a 150994952 byte allocation with 180231120 free bytes and 171MB until OOM, target footprint 385875968, growth limit 385875968" (VmSize 36207920 kB)
2024-05-16 00:24:22.004  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:22.004  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:22.013  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:24.729  9492-9577  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB
2024-05-16 00:24:24.729  9492-9577  md.obsidian          md.obsidian                     I  Alloc concurrent mark compact GC freed 1112431(27MB) AllocSpace objects, 1(72MB) LOS objects, 27% free, 268MB/368MB, paused 70us,1.112ms total 2.724s
2024-05-16 00:24:24.729  9492-9503  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Background on Alloc for 2.724s
2024-05-16 00:24:24.729  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on HeapTrim for 2.716s
2024-05-16 00:24:24.729  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:24.729  9492-9492  Choreographer        md.obsidian                     I  Skipped 326 frames!  The application may be doing too much work on its main thread.
2024-05-16 00:24:24.863  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:24.863  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:24.873  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:27.546  9492-9577  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB
2024-05-16 00:24:27.546  9492-9577  md.obsidian          md.obsidian                     I  Alloc concurrent mark compact GC freed 3987536(99MB) AllocSpace objects, 0(0B) LOS objects, 27% free, 268MB/368MB, paused 76us,1.496ms total 2.683s
2024-05-16 00:24:27.546  9492-9503  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Background on Alloc for 2.683s
2024-05-16 00:24:27.547  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Alloc for 2.673s
2024-05-16 00:24:27.547  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:27.547  9492-9492  Choreographer        md.obsidian                     I  Skipped 321 frames!  The application may be doing too much work on its main thread.
2024-05-16 00:24:27.678  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:27.685  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:30.386  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB
2024-05-16 00:24:30.387  9492-9503  md.obsidian          md.obsidian                     I  Background concurrent mark compact GC freed 3990049(99MB) AllocSpace objects, 0(0B) LOS objects, 27% free, 268MB/368MB, paused 89us,1.591ms total 2.708s
2024-05-16 00:24:30.387  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.708s
2024-05-16 00:24:30.387  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:30.387  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.701s
2024-05-16 00:24:30.387  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:30.387  9492-9492  Choreographer        md.obsidian                     I  Skipped 324 frames!  The application may be doing too much work on its main thread.
2024-05-16 00:24:30.528  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:30.539  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:33.142  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB
2024-05-16 00:24:33.142  9492-9503  md.obsidian          md.obsidian                     I  Background concurrent mark compact GC freed 3990036(99MB) AllocSpace objects, 0(0B) LOS objects, 27% free, 268MB/368MB, paused 84us,1.537ms total 2.614s
2024-05-16 00:24:33.142  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on HeapTrim for 2.603s
2024-05-16 00:24:33.142  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:33.142  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on HeapTrim for 2.614s
2024-05-16 00:24:33.142  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:33.142  9492-9492  Choreographer        md.obsidian                     I  Skipped 312 frames!  The application may be doing too much work on its main thread.
2024-05-16 00:24:33.284  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:36.122  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB
2024-05-16 00:24:36.122  9492-9503  md.obsidian          md.obsidian                     I  Background concurrent mark compact GC freed 3946595(98MB) AllocSpace objects, 12(1000KB) LOS objects, 27% free, 268MB/368MB, paused 93us,1.621ms total 2.837s
2024-05-16 00:24:36.122  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.837s
2024-05-16 00:24:36.122  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:36.264  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:36.271  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:38.934  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB
2024-05-16 00:24:38.934  9492-9503  md.obsidian          md.obsidian                     I  Background concurrent mark compact GC freed 3984042(99MB) AllocSpace objects, 0(0B) LOS objects, 27% free, 268MB/368MB, paused 70us,1.271ms total 2.669s
2024-05-16 00:24:38.934  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.670s
2024-05-16 00:24:38.934  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:38.934  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.662s
2024-05-16 00:24:38.934  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:38.934  9492-9492  Choreographer        md.obsidian                     I  Skipped 320 frames!  The application may be doing too much work on its main thread.
2024-05-16 00:24:39.083  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:39.092  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:41.817  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB
2024-05-16 00:24:41.817  9492-9503  md.obsidian          md.obsidian                     I  Background concurrent mark compact GC freed 3987571(99MB) AllocSpace objects, 0(0B) LOS objects, 27% free, 268MB/368MB, paused 102us,1.201ms total 2.734s
2024-05-16 00:24:41.818  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on HeapTrim for 2.725s
2024-05-16 00:24:41.818  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:41.818  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on HeapTrim for 2.734s
2024-05-16 00:24:41.818  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:41.818  9492-9492  Choreographer        md.obsidian                     I  Skipped 327 frames!  The application may be doing too much work on its main thread.
2024-05-16 00:24:41.965  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:41.970  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:44.669  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB
2024-05-16 00:24:44.669  9492-9503  md.obsidian          md.obsidian                     I  Background concurrent mark compact GC freed 3988800(99MB) AllocSpace objects, 0(0B) LOS objects, 27% free, 268MB/368MB, paused 91us,1.535ms total 2.704s
2024-05-16 00:24:44.670  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.704s
2024-05-16 00:24:44.670  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:44.670  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.700s
2024-05-16 00:24:44.670  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:44.823  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:44.829  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:47.498  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB
2024-05-16 00:24:47.498  9492-9503  md.obsidian          md.obsidian                     I  Background concurrent mark compact GC freed 3988818(99MB) AllocSpace objects, 0(0B) LOS objects, 27% free, 268MB/368MB, paused 102us,1.617ms total 2.674s
2024-05-16 00:24:47.499  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.675s
2024-05-16 00:24:47.499  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:47.499  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.669s
2024-05-16 00:24:47.499  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:47.499  9492-9492  Choreographer        md.obsidian                     I  Skipped 321 frames!  The application may be doing too much work on its main thread.
2024-05-16 00:24:47.682  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:47.690  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:50.445  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB
2024-05-16 00:24:50.445  9492-9503  md.obsidian          md.obsidian                     I  Background concurrent mark compact GC freed 3990143(99MB) AllocSpace objects, 0(0B) LOS objects, 27% free, 268MB/368MB, paused 79us,1.556ms total 2.763s
2024-05-16 00:24:50.445  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on HeapTrim for 2.754s
2024-05-16 00:24:50.445  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:50.445  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on HeapTrim for 2.763s
2024-05-16 00:24:50.445  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:50.445  9492-9492  Choreographer        md.obsidian                     I  Skipped 331 frames!  The application may be doing too much work on its main thread.
2024-05-16 00:24:50.587  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:50.593  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:53.311  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB
2024-05-16 00:24:53.311  9492-9503  md.obsidian          md.obsidian                     I  Background concurrent mark compact GC freed 3990041(99MB) AllocSpace objects, 0(0B) LOS objects, 27% free, 268MB/368MB, paused 108us,1.588ms total 2.724s
2024-05-16 00:24:53.312  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.724s
2024-05-16 00:24:53.312  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:53.312  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.718s
2024-05-16 00:24:53.312  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:53.472  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:53.478  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:56.199  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB
2024-05-16 00:24:56.199  9492-9503  md.obsidian          md.obsidian                     I  Background concurrent mark compact GC freed 3990038(99MB) AllocSpace objects, 0(0B) LOS objects, 27% free, 268MB/368MB, paused 94us,1.574ms total 2.727s
2024-05-16 00:24:56.200  9492-9577  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.727s
2024-05-16 00:24:56.200  9492-9577  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:56.200  9492-9492  md.obsidian          md.obsidian                     I  WaitForGcToComplete blocked Alloc on Background for 2.721s
2024-05-16 00:24:56.200  9492-9492  md.obsidian          md.obsidian                     I  Starting a blocking GC Alloc
2024-05-16 00:24:56.200  9492-9492  Choreographer        md.obsidian                     I  Skipped 327 frames!  The application may be doing too much work on its main thread.
2024-05-16 00:24:56.332  9492-9577  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:56.339  9492-9492  md.obsidian          md.obsidian                     I  Waiting for a blocking GC Alloc
2024-05-16 00:24:59.122  9492-9503  md.obsidian          md.obsidian                     I  Clamp target GC heap from 460MB to 368MB

Basically, once checklist plugin started loading, something (either the plugin or obsidian or else) started to allocate memory non-stop on the main thread, leading to frozen UI (as reported by Choreographer and GC). This log piece is not complete as it repeats for quite a while, during which obsidian is completely frozen. Eventually, the following exception is thrown:

2024-05-16 00:25:25.429  9492-9577  AndroidRuntime       md.obsidian                     E  FATAL EXCEPTION: CapacitorPlugins (Ask Gemini)
                                                                                            Process: md.obsidian, PID: 9492
                                                                                            java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
                                                                                                at com.getcapacitor.Bridge.lambda$callPluginMethod$0(Bridge.java:806)
                                                                                                at com.getcapacitor.Bridge.$r8$lambda$ehFTi5f4HhVNFKTbCKAYDkpQYRA(Unknown Source:0)
                                                                                                at com.getcapacitor.Bridge$$ExternalSyntheticLambda3.run(Unknown Source:8)
                                                                                                at android.os.Handler.handleCallback(Handler.java:958)
                                                                                                at android.os.Handler.dispatchMessage(Handler.java:99)
                                                                                                at android.os.Looper.loopOnce(Looper.java:205)
                                                                                                at android.os.Looper.loop(Looper.java:294)
                                                                                                at android.os.HandlerThread.run(HandlerThread.java:67)
                                                                                            Caused by: java.lang.reflect.InvocationTargetException
                                                                                                at java.lang.reflect.Method.invoke(Native Method)
                                                                                                at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:138)
                                                                                                at com.getcapacitor.Bridge.lambda$callPluginMethod$0(Bridge.java:797)
                                                                                                at com.getcapacitor.Bridge.$r8$lambda$ehFTi5f4HhVNFKTbCKAYDkpQYRA(Unknown Source:0) 
                                                                                                at com.getcapacitor.Bridge$$ExternalSyntheticLambda3.run(Unknown Source:8) 
                                                                                                at android.os.Handler.handleCallback(Handler.java:958) 
                                                                                                at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                                                at android.os.Looper.loopOnce(Looper.java:205) 
                                                                                                at android.os.Looper.loop(Looper.java:294) 
                                                                                                at android.os.HandlerThread.run(HandlerThread.java:67) 
                                                                                            Caused by: java.lang.OutOfMemoryError: Failed to allocate a 301989896 byte allocation with 104471504 free bytes and 99MB until OOM, target footprint 385875968, growth limit 385875968
                                                                                                at java.util.Arrays.copyOf(Arrays.java:3578)
                                                                                                at java.lang.AbstractStringBuilder.ensureCapacityInternal(AbstractStringBuilder.java:177)
                                                                                                at java.lang.AbstractStringBuilder.append(AbstractStringBuilder.java:543)
                                                                                                at java.lang.StringBuilder.append(StringBuilder.java:186)
                                                                                                at org.json.JSONStringer.string(JSONStringer.java:352)
                                                                                                at org.json.JSONStringer.value(JSONStringer.java:261)
                                                                                                at org.json.JSONObject.writeTo(JSONObject.java:734)
                                                                                                at org.json.JSONStringer.value(JSONStringer.java:246)
                                                                                                at org.json.JSONObject.writeTo(JSONObject.java:734)
                                                                                                at org.json.JSONObject.toString(JSONObject.java:702)
                                                                                                at com.getcapacitor.PluginResult.toString(PluginResult.java:67)
                                                                                                at com.getcapacitor.MessageHandler.sendResponseMessage(MessageHandler.java:126)
                                                                                                at com.getcapacitor.PluginCall.resolve(PluginCall.java:74)
                                                                                                at com.capacitorjs.plugins.filesystem.FilesystemPlugin.readFile(FilesystemPlugin.java:119)
                                                                                                at java.lang.reflect.Method.invoke(Native Method) 
                                                                                                at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:138) 
                                                                                                at com.getcapacitor.Bridge.lambda$callPluginMethod$0(Bridge.java:797) 
                                                                                                at com.getcapacitor.Bridge.$r8$lambda$ehFTi5f4HhVNFKTbCKAYDkpQYRA(Unknown Source:0) 
                                                                                                at com.getcapacitor.Bridge$$ExternalSyntheticLambda3.run(Unknown Source:8) 
                                                                                                at android.os.Handler.handleCallback(Handler.java:958) 
                                                                                                at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                                                                at android.os.Looper.loopOnce(Looper.java:205) 
                                                                                                at android.os.Looper.loop(Looper.java:294) 
                                                                                                at android.os.HandlerThread.run(HandlerThread.java:67) 

Which is simply the operating system killing obsidian due to OOM.


viocha commented 3 months ago

The problem still exits on my Android device