cpisciotta / xcbeautify

A little beautifier tool for xcodebuild
MIT License
915 stars 62 forks source link

Huge memory allocation with a big log file. #256

Closed blastmann closed 3 months ago

blastmann commented 4 months ago

I try to debug xcbeatify with a 250MB xcode build log file.

After running a moment, memory allocation is up to 1.1GB above. I think that is not a proper memory consumption.

image

So I dig into the memory allocation of this situation, there is a while-loop in Xcbeatify.swift without autoreleasepool.

Maybe we should consider to add a proper autoreleasepool in order to keep a low memory level like this:

image
cpisciotta commented 4 months ago

Hi @blastmann! I released two new versions of xcbeautify yesterday.

I tried your suggestion, using autoreleasepool, with the latest release, but I'm not seeing any significant differences in memory consumption.

This is not to say there aren't additional areas for improvement, but I think you'll notice notable improvements with the recently released versions. Let me know!

blastmann commented 4 months ago

Hi @cpisciotta. So glad to see there is a huge performance improvement.

I test the memory consumption with the newest code and it doesn't easy to reproduce this issue any more.

Using autoreleasepool in loop is some kinds of best practise of performance optimization and release memory ASAP.

Maybe we should consider using it in this situation. :)