Bug 865053

Summary: Free copied data from vdagent after copy&paste finishes successfully
Product: Red Hat Enterprise Linux 8 Reporter: Marian Krcmarik <mkrcmari>
Component: spice-vdagent-winAssignee: Arnon Gilboa <agilboa>
Status: CLOSED NOTABUG QA Contact: Desktop QE <desktop-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: ---CC: cfergeau, dblechte, dyasny
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-10-11 16:13:46 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Marian Krcmarik 2012-10-10 17:10:28 UTC
Description of problem:
Free copied data from vdagent after copy&paste finishes successfully, It seems like vdagent process keeps copied data from client to guest in memory and does not free it after copy&paste is done, It is visible mainly when doing huge copy&paste - like dozens of megabytes. This is not observed with the linux vdagent.

Version-Release number of selected component (if applicable):
vdagent-win 0.1-12

How reproducible:
Always

Steps to Reproduce:
1. Connect to a windows guest with installed and running vdagent
2. Place huge text into clipboard on the client machine.
3. Paste it on the guest.
4. Check memory usage of vdagent process.
  
Actual results:
The memory usage seems to be increased by amount of copied text.

Expected results:
The memory should be freed after the copy&paste is done.

Additional info:

Comment 1 Arnon Gilboa 2012-10-11 15:39:53 UTC
Seems like it's not a bug. That's the way clipboard works in Windows. Each time an application sets the clipboard, it cannot free the data. This happens automatically by the system when another appliaction sets the clipboard, or when it's cleaned.

"If SetClipboardData succeeds, the system owns the object identified by the hMem parameter. The application may not write to or free the data once ownership has been transferred to the system." (In our case the application is vdagent)
http://msdn.microsoft.com/en-us/library/windows/desktop/ms649051%28v=vs.85%29.aspx

Comment 2 Marian Krcmarik 2012-10-11 16:13:46 UTC
(In reply to comment #1)
> Seems like it's not a bug. That's the way clipboard works in Windows. Each
> time an application sets the clipboard, it cannot free the data. This
> happens automatically by the system when another appliaction sets the
> clipboard, or when it's cleaned.
> 
> "If SetClipboardData succeeds, the system owns the object identified by the
> hMem parameter. The application may not write to or free the data once
> ownership has been transferred to the system." (In our case the application
> is vdagent)
> http://msdn.microsoft.com/en-us/library/windows/desktop/ms649051%28v=vs.
> 85%29.aspx

Ok, Thanks for looking at that, I will close in that case.