Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

Creation of PDF reports fails in some cases, uses too much memory #2052

Closed
anonymous-piwik-user opened this Issue · 11 comments

2 participants

Anonymous Piwik user Anthon Pang
Anonymous Piwik user

When I try to create any PDF report from a medium traffic website (300-500 visitors a day) and the Seach engines option under references is checked i get the folowing error:

Fatal error: Allowed memory size of 268435456 bytes exhausted (tried to allocate 523800 bytes) in /var/www/vhosts/######/httpdocs/libs/tcpdf/tcpdf.php on line 7794
Anthon Pang
Collaborator

Attachment:
2052.patch

Anthon Pang
Collaborator

memory issues are generally covered by #766

can you see if the attached patch helps?

Anonymous Piwik user

The patch didn't work. I still get the same error.

Anthon Pang
Collaborator

You're probably missing this mem leak patch: [3670].

Anonymous Piwik user

The mem leak patch didn't solve it either.

Anthon Pang
Collaborator

The tcpdf library has some unusually large memory requirements when there are images. The only workaround at this point is to increase your max memory limit (see php.ini).

Anonymous Piwik user

The memory limit is already at 256M, I really don't want to allow it to take it more memory. Is there a way to make reports without images?

Anthon Pang
Collaborator

I'm going to report this upstream. Otherwise I'd have to dig thru the tcpdf code to figure out why it needs a meg of memory for a tiny search engine icon.

Anonymous Piwik user

cheers, I'll keep an eye on it

Anthon Pang
Collaborator

Another idea would be to try with the imagick extension installed as it uses a different code path in tcpdf. http://ca.php.net/manual/en/book.imagick.php

Anthon Pang
Collaborator

(In [3848]) fixes #2067, refs #2052 - remove alpha channel (transparent layer) from icons

For future reference, use ImageMagick:

  • convert image.png -background white -flatten +matte image_new.png
Anonymous Piwik user anonymous-piwik-user added this to the Piwik 1.2 milestone
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.