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

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

Closed
anonymous-matomo-user opened this issue Jan 28, 2011 · 11 comments
Closed
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Milestone

Comments

@anonymous-matomo-user
Copy link

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
@robocoder
Copy link
Contributor

Attachment:
2052.patch

@robocoder
Copy link
Contributor

memory issues are generally covered by #766

can you see if the attached patch helps?

@anonymous-matomo-user
Copy link
Author

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

@robocoder
Copy link
Contributor

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

@anonymous-matomo-user
Copy link
Author

The mem leak patch didn't solve it either.

@robocoder
Copy link
Contributor

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-matomo-user
Copy link
Author

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?

@robocoder
Copy link
Contributor

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-matomo-user
Copy link
Author

cheers, I'll keep an eye on it

@robocoder
Copy link
Contributor

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

@robocoder
Copy link
Contributor

(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

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For errors / faults / flaws / inconsistencies etc.
Projects
None yet
Development

No branches or pull requests

2 participants