chobie / php-protocolbuffers

PECL ProtocolBuffers
pecl.php.net/package/protocolbuffers
Other
128 stars 38 forks source link

Memory leak in examples/prefecture.php #32

Closed dcelasun closed 10 years ago

dcelasun commented 10 years ago

I have added the following line to the end of examples/prefecture.php:

printf("# memory: %d\n", memory_get_peak_usage());

Here's the output:

$ php prefecture.php 
# decoding benchmark (protocolbuffers).
# target message size: 1195 bytes.
# start
# Result:
# decoding 10000 messages
# processing time: 1.668647 (0.000167/message)
# total bytes: 11950000 bytes
# memory: 661161504

Even though the message is 11MB (total bytes in the output), memory usage peaked at 630MB! This is extremely high and it looks like there is a memory leak. Maybe it's related to this?

chobie commented 10 years ago

thanks reporting an issue.

hmm, I didn't expect that. let me inspect potential leaks.

chobie commented 10 years ago

I've released PECL protocolbuffers 0.2.2 last night. please check it.

dcelasun commented 10 years ago

Just checked. Memory usage dropped from 630MB to 0.4MB! Great work, thanks!