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

Memory exhausted on putEvent #83

Open
tomvo opened this issue Nov 30, 2022 · 3 comments
Open

Memory exhausted on putEvent #83

tomvo opened this issue Nov 30, 2022 · 3 comments

Comments

@tomvo
Copy link

tomvo commented Nov 30, 2022

I'm getting sometimes a memory exhausted exception on the following location: /vendor/nipwaayoni/elastic-apm-php-agent/src/Middleware/Connector.php@putEvent()

I assume it has to do with encoding the payload for an exception or another trace that is too large. Is there a way to limit large payloads being trying to be sent to APM?

@dstepe
Copy link
Contributor

dstepe commented Nov 30, 2022

If an excessively large stack trace is the culprit, you might be able to use the stack-trace-limit option to mitigate it. If it's an exception content or something else, then no, there is no overall control of the content size.

Memory configuration is implementation specific, and efficient memory usage is up to the application. Have you considered increasing the memory for the PHP process? Or could accumulated large objects/data structures in the application contribute to this?

@tomvo
Copy link
Author

tomvo commented Nov 30, 2022

thanks for replying Dirk. I looked further into this and it does seem to occur on locations where we are handling large amounts of data. It's internal RPC calls with a lot of bulk elasticsearch data. I guess the stack-trace-limit option might not mitigate this. However i'm wondering why we're seeing an Exception in the APM library since i don't see any exceptions being triggered that is causing a log to APM.

@dstepe
Copy link
Contributor

dstepe commented Nov 30, 2022

How are you using this package? In most cases, APM collects more than exceptions. I would expect there to be transactions sent to APM regardless of any exceptions. I would not be surprised that your process runs fine, collecting transactions with potentially lots of spans and metadata, then passes it all to the agent to send to APM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants