[KimDaBa] Reducing memory consumption

Robert L Krawitz rlk at alum.mit.edu
Sun Jan 16 14:27:27 CET 2005


   From: "Jesper K. Pedersen" <blackie at blackie.dk>
   Date: Sun, 16 Jan 2005 20:20:51 +0100
   Cc: kimdaba at klaralvdalens-datakonsult.se

   On Sunday 16 January 2005 20:17, Robert L Krawitz wrote:
   |    From: "Jesper K. Pedersen" <blackie at blackie.dk>
   |    Date: Sun, 16 Jan 2005 20:09:30 +0100
   |
   |    I'm afraid that I can't apply this patch.  I need to detach
   |    otherwise there might be a race condition between the two threads
   |    for the reference counter for the QImage.  I changed the code so it
   |    will detach right after putting the image in the ImageEvent, this
   |    will hopefully resolve the issue, and will ensure that the image is
   |    not copied an extra time when taken out of the event in the GUI
   |    code.
   |
   | So that's still going to force a copy?  That's unfortunate, since it's
   | a huge chunk of VM.  There's no way to lock the image?

   I'm afraid not.  The problem is that the GUI thread and the image
   loading thread might at the same time reduce the reference counter,
   resulting in it being decrecaded one too little.

It's not possible to lock the operations that might change the
reference counter?

   |    Please CVS up, and let me know if the change result in any crashes
   |    in the image loading code.
   |
   | I did; there was no change (does it take time to propagate to the
   | public CVS?)

   I don't know, but when writting the mail I hadn't checked in the change, 
   please try again, it should be in now.

Still no luck.



More information about the KimDaBa mailing list