Skip to content

Memory Leaks During Debugging in WebKitGTK (Linux Virtual Environment) #1005

Description

@clockei

Hello.
I’m developing an app using Tauri 2.0 and the Powersync JavaScript SDK.
When I run npm run tauri dev to debug and create a Powersync instance, memory usage continues to rise for several tens of seconds after startup.
After that, when memory usage exceeds 50% of the virtual machine’s allocated capacity, the following message appears in the debug terminal, and the app freezes:
Unable to reduce the process’s memory usage (16936 MB) below the kill threshold (16384 MB). The process has been terminated.

Currently, I am temporarily working around this issue by pinning the SDK version to 1.37.2 (wa-sqlite is 1.5.0).

Environment

  • @powersync/web: 1.38.0 or later
  • @powersync/react: 1.10.0
  • @journeyapps/wa-sqlite: 1.7.0
  • @react: 19.2.7
  • @Vite: 8.0.16
  • Tauri 2.0

Details

This issue has been occurring more frequently since @powersync/web was updated to version 1.38.0 or later.
Even after rolling back @powersync/web to version 1.37.2, the phenomenon of rising memory usage persists; however, at a certain point (before reaching the 50% threshold at which the process terminates), the usage drops sharply and stabilizes, after which it begins to fluctuate.

Although other causes were suspected, we concluded that this is most likely an issue on the PowerSync SDK side, as the memory leak did not occur when new PowerSyncDatabase() was not called.

Furthermore, as of now, the memory leak has not been confirmed outside of debugging on Linux (in an environment where WebView uses WebKitGTK).

PowerSync Instance Configuration

const powerSyncDatabase = new PowerSyncDatabase({
  schema: AppSchema,
  database: {dbFilename: ‘powersync.db’}
  flags: {
    enableMultiTabs: false,
  }
})

Finally
Since I’m using a translation tool, there may be some errors in the English translation. I apologize for any inconvenience.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions