Skip to content

Huge memory usage with serde proc macros #16188

@vdrn

Description

@vdrn

Problem description

Rust analyzer keeps using more and more memory. It seems to be connected with serdes proc_macros and many fields in the struct.

After the file is opened, during the first minute, memory keeps slowly rising to about 3gb.
At around 2 min mark, it suddenly spikes to 4.3gb.
Around 3-4 mins, it spikes to 7gb.
Around 6-7 mins, it spikes to 12gb.

During all this time, CPU usage is 100% (not all cores, just one).

Started happening a month or 2 ago (I do weekly rust-analyzer updates).

Steps to reproduce

  • Fresh install of VSCode on Ubuntu 20.04,
  • clone this repo
  • open main.rs and do nothing, just watch CPU/RAM

rust-analyzer version: 0.3.1774-standalone

rustc version: rustc 1.74.1 (a28077b28 2023-12-04)

relevant settings: fresh vs-code install, no custom settings, no ENV variables set

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions