Skip to content
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

[Draft] Release font resources to fix memory leak #9250

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

hiteshwpfmsft
Copy link

@hiteshwpfmsft hiteshwpfmsft commented Jun 14, 2024

Fixes #6296

Description

Printing a large size of document ends up consuming a lot of memory. The change in the PR targets to address this issue.
This change releases the font resources after every four pages. We see huge memory consumption difference as the number of pages grow.
Also, with the change we make sure that all resources gests released once printing is completed.

image

Regression

Don't know.

Testing

Under testing.

Risk

Low.

@hiteshwpfmsft hiteshwpfmsft added * NO MERGE * metadata: The PR is not ready for merge yet (see discussion for detailed reasons) draft labels Jun 14, 2024
@hiteshwpfmsft hiteshwpfmsft requested a review from a team as a code owner June 14, 2024 16:27
@dotnet-policy-service dotnet-policy-service bot added PR metadata: Label to tag PRs, to facilitate with triage and removed draft labels Jun 14, 2024
@hiteshwpfmsft hiteshwpfmsft marked this pull request as draft June 14, 2024 16:48
@@ -23,16 +23,16 @@ namespace System.Windows.Xps.Serialization.RCW
[ComImport]
internal interface IXpsOMPartUriCollection
{
void Append([In] IOpcPartUri partUri);
uint GetCount();
Copy link
Contributor

@lindexi lindexi Jun 24, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After reading xpsobjectmodel.h, I think your changes are correct.

Addition, the define of IXpsOMPartUriCollection in xpsobjectmodel.h:

    MIDL_INTERFACE("57C650D4-067C-4893-8C33-F62A0633730F")
    IXpsOMPartUriCollection : public IUnknown
    {
    public:
        virtual HRESULT STDMETHODCALLTYPE GetCount( 
            /* [retval][out] */ __RPC__out UINT32 *count) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE GetAt( 
            /* [in] */ UINT32 index,
            /* [retval][out] */ __RPC__deref_out_opt IOpcPartUri **partUri) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE InsertAt( 
            /* [in] */ UINT32 index,
            /* [in] */ __RPC__in_opt IOpcPartUri *partUri) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE RemoveAt( 
            /* [in] */ UINT32 index) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE SetAt( 
            /* [in] */ UINT32 index,
            /* [in] */ __RPC__in_opt IOpcPartUri *partUri) = 0;
        
        virtual HRESULT STDMETHODCALLTYPE Append( 
            /* [in] */ __RPC__in_opt IOpcPartUri *partUri) = 0;
        
    };

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
draft * NO MERGE * metadata: The PR is not ready for merge yet (see discussion for detailed reasons) PR metadata: Label to tag PRs, to facilitate with triage
Projects
None yet
Development

Successfully merging this pull request may close these issues.

XPS huge memory issues
3 participants