linuxmint / sticky

A sticky notes app for the linux desktop
GNU General Public License v2.0
187 stars 40 forks source link

Fixed RAM consumption when dragging notes #72

Closed ivanrg99 closed 2 years ago

ivanrg99 commented 2 years ago

When a note is moved, removed the call to queue update the note since it was unnecessary and generated a bunch of new Note Entry instances that could end up costing a lot of memory

collinss commented 2 years ago

I'm sorry, but that line is actually necessary. Removing it introduces a regression in which the position is not saved after dragging the note. Any subsequent changes that trigger a save (such as typing in the note or editing the note title) will also save the new position, but if the user never does any of those things before quitting the app or switching to another group, it won't get saved. This can be quite frustrating if you've spent some time arranging your notes, only to come back later and find that it didn't take.

Also, this doesn't actually fix the memory leak, it just makes it less noticeable when you drag notes around a lot.

I appreciate the contribution, but I'd prefer not to apply a hack that I know introduces a regression, and which doesn't really fix the underlying issue.

ivanrg99 commented 2 years ago

I see, I could replicate the exact regression issue you were talking about. Thanks for the insight, I had no idea this was an issue.

collinss commented 2 years ago

No worries! I do intend to fix the underlying memory leak, but it is not trivial as the code in question is an interaction between c and python by way of gobject introspection, so traditional methods of tracking down leaks are messy at best.