Skip to content

Large increase in memory use upon paste and delete operations in certain spreadsheets #433

Description

@m7a

Hello,

I have found a memory-management issue but could not get my head around debugging it completely.

Here is how to reproduce it:

  1. $ sc-im debugsc.sc
  2. go to G1
  3. visual mark G1:G20
  4. y
  5. goto H1
  6. Pc
  7. Got: Large increase in memory use (from 5 MiB to ~ 2 GiB), sc-im becomes unresponsive.
    Expected: Program responds immediately

Note: When saving the changes and opening the changed file, memory use is down to 5 MiB again... until one attempts to delete the newly added cells. If doing this with visual select and then x, memory use will again increase to around 2 GiB...

My local configuration (~/.config/scimrc) has this (but the problem seems to appear without any scimrc, too):

set autocalc

Memory profiler screenshot

Attachments

  • debugsc.sc.txt -- failing spreadsheet
  • debuglo.zip -- same sheet in LibreOffice
    (does not exhibit excessive memory usage, thus it should not be the computation's problem)
  • massif.out.1307.txt -- memory profiler data
    (obtained through valgrind --tool=massif --heap=yes --stacks=yes ./sc-im debugsc.sc)

System data:

  • git commit a4abe78
  • Debian 10 GNU/Linux 4.19.0-9-amd64
  • gcc version 8.3.0 (Debian 8.3.0-6)

I appreciate it very much if someone more knowledgeable of the source code could check this issue?

Thanks in advance

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions