← Back to team overview

gtg-contributors team mailing list archive

[Bug 619603] Re: Confirm we want to remove a task just remove the task from the ui, the task still exist. (This can cause huge memory leaks)

 

 Well, when you save the task, it is stored in ram no ? (In
task.content)

 When you work with large files or with many files, task.content can be
a big memory waster.

[ Try to do:
a = 1000000 *  "Large text "
a.__sizeof__() ]

 SO when we remove the task, this doesn't get deleted...

 Imagine now you're using GTG all the time and you've like 50 taks per
day, at the end of the day, ram usage would be very high.

 I'll make a screenshot (It's done with a deleted 15000 char task, I
know no one uses so long tasks, but someone that would use his computer
without closing GTG for one week will have a similar size.)

 If a task is deleted, we also need to remove the content, since we
don't use it anymore. We keep only active and dismissed tasks.

[Note: Python is the gtg process.]

** Attachment added: "Big memory"
   https://bugs.launchpad.net/gtg/+bug/619603/+attachment/1578466/+files/Capture.png

-- 
Confirm we want to remove a task just remove the task from the ui, the task still exist. (This can cause huge memory leaks)
https://bugs.launchpad.net/bugs/619603
You received this bug notification because you are a member of Gtg
contributors, which is subscribed to Getting Things GNOME!.

Status in Getting Things GNOME!: Confirmed

Bug description:
[From both bzr and ppa.]

This was firstly reported as a comment in another mine report bug. Reporting here as those are separate bugs.

How to reproduce the bug.
Launch gtg.
Create a Task.
Fill it with some text (Like ~5000 char to see the problem.)
Look at memory used by the process.
Remove the task.
Look at the memory used by the process.
The memory is not freed...

Expected:
Memory is freed when task is deleted, not just delete the task from the ui.

This is severe for a user that would use frequently gtg without ever restarting it. (Why would you restart it, you can hibernate, etc...), the memory would grow little by little (Even with not so big content tasks.)...

Why is there this problem ?

Because when you confirm that you want to delete the task the code is this one:

    def on_delete_confirm(self, widget):
        """if we pass a tid as a parameter, we delete directly
        otherwise, we will look which tid is selected"""
        for tid in self.tids_todelete:
            task = self.req.delete_task(tid)
        self.tids_todelete = []

And self.tids_todelete is []