Thibault > I'm not a memory specialist but, afaik, when you exit a
method in python, all the local variables are garbage collected and
should not be stored in memory anymore. In your example, a would be
freeed as soon as the calling method exit.  Also, in your code, "task"
is a pointer to an existing object. Not a copy of the full object.

I will try to summarize what I think I understand from what you are
saying, correct me if I'm wrong :

- Tasks take memory. (That's it, there's little we can do about it.)
- When you delete a task, the task stay in memory.  (that's what you want to 
solve)

My answer :
1. I don't understand how it could happen because we don't have any reference 
left to the old task. It should be freeed sooner or later. If not, have you any 
idea where the forgotten reference is ?  Task.content will be deleted as soon 
as there is no reference to the task itself.
2. If it's confirmed, then it's a bug, yes.
3. This is not a critical bug at all because deleting tasks is not something 
frequent. I mean, when you have 1000 tasks, even if you delete 10, it's not a 
huge deal. Removing 1500 tasks is not a critical usecase (I don't say it 
shouldn't be fixed, just that I fail to see this as critical, even for hardcore 
users)


Another interpretation of your bug report is that, when deleted, the
task is duplicated into memory. I don't even understand how it could be
possible. (I don't say it's impossible, I just say that I don't see it)


PS: also, in trunk, the code is not exactly the one you copied in your
report.

-- 
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 []



_______________________________________________
Mailing list: https://launchpad.net/~gtg-contributors
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~gtg-contributors
More help   : https://help.launchpad.net/ListHelp

Reply via email to