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

High Memory usage caused by opacity #2950

Closed
hs4b opened this issue May 15, 2016 · 2 comments

Comments

3 participants
@hs4b
Copy link

commented May 15, 2016

Hello devs,

while the html → pdf conversion on an MBP (16GB ram) worked like a charm as usual, i experienced a memory leak after the productive delivery on a low mem machine.

Both are running: wkhtmltopdf 0.12.3 (with patched qt)

Edit: replaced attachment by the code...it's not that much

<!doctype html>
<html lang="de">
<head>
    <meta charset="UTF-8">
    <title></title>
    <style>
        html, body {
            width: 210mm;
            height: 297mm;
            background-color: #ffffff !important;
            font: 11pt/160% Verdana, Arial, sans-serif;
        }

        .watermark {
            display: block;
            position: fixed;
            z-index: 999;
            width: 90mm;
            height: 45mm;
            top: 165mm;
            left: 27mm;

            color: #ff0000;
            font-size: 10em;            
            opacity: 0.3; /* comment this line out and mem usage will be reduced to ~0 */

            -webkit-transform:rotate(-45deg);
            -moz-transform:rotate(-45deg);
            -o-transform:rotate(-45deg);
            transform:rotate(-45deg);
        }

    </style>
</head>
<body>
    <div class="watermark">let's blow mem</div>
</body>
</html>

So just save the file and run: wkhtmltopdf [file_name].html [file_name].pdf and your mem usage should raise to ~1GB.

To verify the difference, comment out the opacity style in .watermark and the conversion will take ~10MB ram.

Hope this helps,
Greetings

@ashkulz

This comment has been minimized.

Copy link
Member

commented May 15, 2016

This is a known issue in WebKit, see #1510. Upgrading the browser engine might fix this -- can you see the performance with 0.13 alpha?.

@ashkulz ashkulz closed this May 15, 2016

@ashkulz ashkulz added the Duplicate label May 15, 2016

@blaggacao

This comment has been minimized.

Copy link

commented Jul 28, 2016

It seems we stumbled (ehem crashed at full spead) into the same issue.
So far I only can report back symtomps, we havn't get to a more detailed analisis but are working on it feverishly.

our monitoring system shows the memory consuption explodes to arround 1GB in a matter of less then our 2s stat's resolution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.