ext-chunkutils2 icon indicating copy to clipboard operation
ext-chunkutils2 copied to clipboard

Extension bypasses Zend Memory Management (ZMM)

Open yoraze opened this issue 1 year ago • 2 comments

This caused by usage of new/delete operators that uses malloc/free instead of emalloc/efree that ZendAPI provides PalettedBlockArray objects bypasses ZMM and this causes noticable incorrect memory consuption calculation in PHP ^ You can also just type "status" in Console on Windows and compare memory usage with taskmanager That problem also may cause slight perfomance degrade but I dont sure about it

Any comments on this or we just should ignore this problem?

yoraze avatar Dec 18 '24 09:12 yoraze

I'm aware of the issue, but it's complicated to fix and probably not worth it. Performance is pretty much irrelevant considering the low frequency of allocations.

Using ZMM comes with its own problems such as thread sharing restrictions, which, considering that I'd had plans to enable sharing PalettedBlockArrays between threads without copying, is a restriction I don't like.

dktapps avatar Dec 18 '24 13:12 dktapps

I'll also point out that PHP memory usage reporting is basically useless in PM anyway since it doesn't count memory from anything but the current thread. You have to look at system memory stats anyway. We don't do this on Windows because there's a significant lag time for the commands needed to retrieve the stats.

dktapps avatar Dec 18 '24 13:12 dktapps