New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Update metadata in the treeview without reload all - Fixes #4852 #520
Conversation
Implement a set_value method in the model, and move the logic to write to the datastore to the ListModel. To be able to update the model without trigger a update in the treeview, we pass the updated callback in the ListModel.setup() method, and the callback is disconnected and connected in every update. The treeview have the responsabilty of redraw the cell after the change was done. The listmodel stores a dictionary with the entries uodated, to provide that data until the next update in the Journal. This patch is heavily based in the work of Sam Parkinson <sam.parkinson3@gmail.com>
|
Just wondering, but would it make it more complex to also cover "details view" metadata? ie., if you scroll to some far below entry and go to details view, any change done to the entry metadata will make it reset the view when pressing the "back" button. |
|
Another case I noticed:
|
|
@tchx84, |
|
|
@godiard, @samdroid-apps lets double check (by code analysis and test) that this doesn't break something else and that it does not change another more-relevant behavior. |
|
@samdroid-apps @godiard , a couple questions to make sure I understand it properly:
|
|
|
Replaced with #564 |
|
Ok, so here are 2 more tests about this patch: 1st, a test where 2nd a test on the master branch (I only toggled the stars of the top entries, and I didn't change the labels of any - the scrolling bug is very annoying!): So, it appears that both before and after the patch, the journal eats ram. I am willing to merge this patch as. It works very well, it is fast and it fixes the bug. It does not have any side effects that I have found through testing. |
|
This might not be a leak. Virtual memory may be released by Python yet be moved to a free list for reallocation. To prove it, I suggest automating and repeating the test sequence you used ... and have it run at least ten times while recording virtual memory size of shell and datastore processes. |
|
Interesting test. What method did you use to graph the memory consumption? |
|
@quozl I agree with you that python is probably not releasing the memory. I'm pretty sure there are a few bugs about how python releases/doesn't-release memory that got fixed in newer versions, maybe only in 3.x though. @godiard I measured the memory of the jarabe process. My method was:
|
|
Cool, it has been about 20 years since I last used plotutils, with an actual plotter. ;-) For comparison, here is a method that I used; you might find it looks nicer and is easier to customise yet still scriptable; Plotting done with gnuplot package with this shell script; comment out the set terminal and set output lines to display on screen; |
|
That's so cool! Plus you found a bug in the background cpanel :) Did you find this journal patch to cause memory leaks? |
|
No, I haven't got an automated test case for that yet. I did check recently on #4852 to make sure the problem was still happening. |
|
Thanks. Ach, crivens, I smell a rat! I did a quick test of several normal UI transitions in Sugar 0.106 while monitoring VmSize of Jarabe. Every single transition tested leaks some amount of memory, which over time will accumulate unless there's something to clean it up. It is critical on the XO-1, which only has 256 MB of RAM.
It will be interesting to see what causes this. As you see the same leak rate with and without your patch, my guess is that we have a wider problem. No need to hold up your patch. My log analysis script: |
|
The leak rate seems proportional to the size of icons and images processed. An automated test method using xdotool has been added to bug #4889, for your interest. |
|
If the leak rate is proportional to the icon sizes, the obvious place to look is icon.py.
|
|
I think that the status of memory leaks in the journal should be an important discussion, but is not related to this patch. There are memory leaks before and after this patch? @godiard |
|
@samdroid-apps, it's not the journal, it's everything. |
|
Merged! |
|
Oh no, I've done something bad with my merge |
|
Yep this merge when really badly and github has seemingly stripped gonzalo's name from the patch. @godiard please re submit the patch with your authorship! I will revert the merge my apologies to everybody. I will merge the patch when it is corrected as the discourse has moved beyond this patch already. |
|
@samdroid-apps, no problem for me, you did all the heavy work. |






Implement a set_value method in the model, and move the logic
to write to the datastore to the ListModel. To be able to
update the model without trigger a update in the treeview,
we pass the updated callback in the ListModel.setup() method,
and the callback is disconnected and connected in every update.
The treeview have the responsabilty of redraw the cell after
the change was done.
The listmodel stores a dictionary with the entries uodated,
to provide that data until the next update in the Journal.
This patch is heavily based in the work of
Sam Parkinson sam.parkinson3@gmail.com