Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] obsidian freezes on enabling the plugin #334

Open
Mahgozar opened this issue Dec 31, 2023 · 14 comments
Open

[BUG] obsidian freezes on enabling the plugin #334

Mahgozar opened this issue Dec 31, 2023 · 14 comments
Labels
bug Something isn't working

Comments

@Mahgozar
Copy link

Problem description:
in installing the plugin and when i enable it on my 8000 notes vault it shows the notification for indexing and after a few seconds obsidian freezes. i can see the ram and CPU usage climb up (nowhere near the limits of my machine)
when i run it with the developer console open it tells me that its stopped before an out of memory crash
but my machine has 16 gigabites of ram this shouldn't be a problem i think (although i have to mention the total size of the vault is 27 gigabytes)

image

Your environment:

  • Omnisearch version: 1.20.2
  • Obsidian version: 1.5.3
  • Operating system: Arch linux
  • Number of indexed documents in your vault (approx.): 8000 notes approaximately 14000 files in total

Things to try:

  • Does the problem occur when Omnisearch is the only active community plugin: yes
  • Does the problem occur when you don't index PDFs, images, or other non-notes files: yes
  • Does the problem occur after a cache reset: yes
@Mahgozar
Copy link
Author

Mahgozar commented Dec 31, 2023

i did a little more tinkering the problem seems to be with my .excalidraw files that are interpreted as really really really big text files
and because of that they make the whole thing fall apart is there anyway to fix this?
perhaps a way to exclude a certain folder path from indexing?

@Mahgozar
Copy link
Author

upon more testing the problem seems to be with JavaScript heap out of memory
image
but the problem is that when i run obsidian using a higher maximum i can't get it to go beyond 4g for some reason it just doesn't listen
image

@scambier
Copy link
Owner

I'll add a setting to make indexing of excalidraw files an opt-in, as a quick fix.

And increasing memory limit in Electron seems to be quite fiddly, if not straight up impossible if you can't build yourself :/
electron/electron#2056

@Mahgozar
Copy link
Author

yeah i've been googling all over the past 6 hours :)))) couldn't find a thing, thank you for the response

@Mahgozar
Copy link
Author

just an idea, can we change anything in that .asar file of obsidian to perhaps make this work differently? i have very limited programming knowledge so i have no idea if this even makes sense

@scambier scambier added the bug Something isn't working label Jan 1, 2024
@scambier
Copy link
Owner

scambier commented Jan 5, 2024

If you update Omnisearch, I added a (hidden) setting excalidrawIndexing. You can modify it in yourvault\.obsidian\plugins\omnisearch\data.json. If you can confirm it "solves" the freeze at startup I'll add a toggle in the settings page 👍

@Mahgozar
Copy link
Author

Mahgozar commented Jan 6, 2024

unfortunately the same problem still very much exists
image
image
image

@scambier
Copy link
Owner

scambier commented Jan 7, 2024

Ok so the crash happening while indexing an excalidraw file was just a coincidence. It's possible that your vault is somehow too large for Omnisearch; or actually, Omnisearch's RAM consumption during indexing is too high for Electron.

Could you try this test build? I've reduced the size of batches during indexing, and added pauses between each batch to (hopefully) let the GC do its thing. omnisearch_1.20.4-bugfix.334.1.zip.

You can extract the files right next to the data.json you previously edited.

@Moyf
Copy link

Moyf commented Jan 18, 2024

I'm not sure if our problem is same, but when enabling Omnisearch, my OB would stuck for seconds.
The console shows:
image

Is this normal?
I have 'bout 700+ md files, and 3000 files at all.

@scambier
Copy link
Owner

Is this normal? I have 'bout 700+ md files, and 3000 files at all.

Not the same problem, as it looks like Omnisearch is correctly indexing your files. If you have a large cache, it can indeed freeze Obsidian for a few second while all the data is processed and loaded in memory.

@scambier
Copy link
Owner

@Mahgozar I have recently updated the cache loading mechanism. Does this issue still persist?

@Mahgozar
Copy link
Author

when i run it with omnisearch it still freezes, im trying to run it for longer periods of time to see what happens but it freezes and gives the following error

obsidian --js-flags='--max-old-space-size=10192'
2024-06-29 10:29:05 Loading main app package /usr/lib/obsidian/obsidian.asar
Removing partition for vault mx-player-3652a80ff677f479
2024-06-29 10:29:05 Checking for update using Github
2024-06-29 10:29:06 Success.
2024-06-29 10:29:06 Latest version is 1.6.5
2024-06-29 10:29:06 App is up to date.
[77645:0629/135943.252984:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[77645:0629/135943.258412:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[77645:0629/135946.060361:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)

@Mahgozar
Copy link
Author

Mahgozar commented Jun 29, 2024

this is the results after 30 minutes
the results are the same without the js flags

obsidian --js-flags='--max-old-space-size=10192'
2024-06-29 10:37:12 Loading main app package /usr/lib/obsidian/obsidian.asar
Removing partition for vault mx-player-3652a80ff677f479
2024-06-29 10:37:12 Checking for update using Github
2024-06-29 10:37:16 Success.
2024-06-29 10:37:16 Latest version is 1.6.5
2024-06-29 10:37:16 App is up to date.
[78206:0629/140738.204375:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 1 times!
[78206:0629/140738.205620:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 2 times!
[78206:0629/140738.223039:ERROR:gl_surface_presentation_helper.cc(260)] GetVSyncParametersIfAvailable() failed for 3 times!
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)
Error sending from webFrameMain:  Error: Render frame was disposed before WebFrameMain could be accessed
    at s._sendInternal (node:electron/js2c/browser_init:2:89062)
    at _._sendInternal (node:electron/js2c/browser_init:2:73537)
    at node:electron/js2c/browser_init:2:101430
    at new Promise (<anonymous>)
    at Object.invokeInWebContents (node:electron/js2c/browser_init:2:101177)
    at _.executeJavaScript (node:electron/js2c/browser_init:2:74499)

@Mahgozar
Copy link
Author

Mahgozar commented Jul 1, 2024

tested again after the new update as well, still faced with out of memory errors

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants