Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

deebow's avatar

High memory usage on every request

Hi,

I just installed clockwork so that I can observe and optimize heavy queries, and I noticed that every request, even the built-in api/health-check consumes 28~35mb memory.

At first, I thought it was an issue related to clockwork, so I decided to try telescope, and it also reports the same memory usage.

By the way, the project is running on docker container locally. I'm not particularly sure, but could it be the reason why?

EDIT:

Tried the following as stated in the documentation.

xdebug.mode = profile xdebug.start_with_request = trigger xdebug.profiler_output_name = cachegrind.out.%u.%r

also tried the following DataSources: PhpDataSource LaravelDataSource

but still doesn't change a thing

0 likes
7 replies
Glukinho's avatar

What makes you think it is high usage?

Do you have unnecessary PHP extensions enabled, like xdebug?

Are there any real performance problems or you're just frightened by 30 Mb consumption?

1 like
deebow's avatar

I'm aware it's pretty normal and that it's not the actual consumption of the request itself... but it would be hard to benchmark with having that memory as the base/default.

also, i don't think it's xdebug's fault, since I had its mode set to coverage only.

deebow's avatar

Yeah, unfortunately, mine's a headless api.

jlrdw's avatar

so that I can observe and optimize heavy queries

Give an example of what you call a heavy query.

And are you using pagination?

deebow's avatar

i don't think this matters...

because as I've mentioned, even a health-check, or Route::get('test', fn () => 'Hello'); still reports 28~35mb memory usage

Please or to participate in this conversation.