8000 Memory leaks. · Issue #1720 · iina/iina · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Memory leaks. #1720

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

Closed
ldwardx opened this issue May 23, 2018 · 8 comments
Closed

Memory leaks. #1720

ldwardx opened this issue May 23, 2018 · 8 comments

Comments

@ldwardx
Copy link
ldwardx commented May 23, 2018

System and IINA version:

  • macOS 10.13.4
  • IINA 0.0.15.1

Expected behavior:

No leaks.

Actual behavior:

1527076132853

Steps to reproduce:

Play a video without cached thumbnails.

How often does this happen?

Every time a thumbnail is generated.

@ldwardx
Copy link
Author
ldwardx commented May 23, 2018

I found three potentially problematic codes in the FFmpegController class.

  1. pFrameRGB should be released using av_frame_free() instead of av_free().
  2. pFrame should be released just like pFrameRGB.
  3. av_packet_unref (&packet) is necessary after calling the saveThumbnail function.

There may be other leaks I did not find.

@saagarjha saagarjha added the bug label May 23, 2018
@saagarjha
Copy link
Member
saagarjha commented May 23, 2018

Thanks for this!

pFrameRGB should be released using av_frame_free() instead of av_frame()

Surely you mean av_free instead of av_frame?

av_packet_unref (&packet) is necessary after calling the saveThumbnail function.

I see a call to av_packet_unref. Could you be more specific as to what you mean?

@ldwardx
Copy link
Author

ldwardx commented May 23, 2018

Surely you mean av_free instead of av_frame?

Sorry, I made a typo and av_frame() should be changed to av_free(),and it has been modified.

I see a call to av_packet_unref. Could you be more specific as to what you mean?

I mean is that it should also call av_packet_unref (&packet) before break.

        ...
        // Save the frame to disk
        [self saveThumbnail:pFrameRGB
                      width:pFrameRGB->width
                     height:pFrameRGB->height
                      index:i
                   realTime:(pFrame->best_effort_timestamp * timebaseDouble)
                    forFile:file];
        break;
        ...

@ldwardx
Copy link
Author
ldwardx commented May 24, 2018

OK, I found the last leaked code.
The structure variable sws_ctx should be released using sws_freeContext().

saagarjha added a commit to saagarjha/iina that referenced this issue May 27, 2018
saagarjha added a commit to saagarjha/iina that referenced this issue Jun 2, 2018
@ldwardx
Copy link
Author
ldwardx commented Jun 28, 2018

@saagarjha
Missed memory leak point.
The getPeeksForFile: method exits prematurely under certain conditions, such as when a macro definition CHECK_SUCCESS and CHECK_NOTNULL determine that there is an error, or other return calls, which causes objects that have already been created to not be released.

@lhc70000 lhc70000 added this to the 1.0.0 milestone Sep 22, 2018
low-batt added a commit to low-batt/iina that referenced this issue Jul 26, 2021
The method `getPeeksForFile` in `FFmpegController` is leaking memory
when generating thumbnails. This commit will:

- Add a `@try-@finally` block in the while loop to free the packet

- Replace `av_free` by `av_frame_free`, when freeing an `AVFrame`

- Add a call to `sws_freeContext` to free the `SwsContext`

- Replace deprecated method `avcodec_close` with `avcodec_free_context`

- Add `nullable` annotation to declaration of `probeVideoInfoForFile`

This is a stopgap fix and does not address all of the potential leaks
in the method. This commit focuses on the leaks that occur during the
normal flow when generating thumbnails. Error flows will still leak
memory. At some point this method should be refactored to always
properly free memory.
@low-batt
Copy link
Contributor

I found this issue searching to see if the memory leaks I'm experiencing have been reported. From reading related issues and pull requests I gather it was decided the correct fix required a major refactoring. Rewrites in Swift and C++ were worked on but were not merged. Then the issue ended up being left open.

I didn't see any mention of using Objective-C's @try-@finally blocks, an effective way to insure close/free code is executed. The disadvantage of using try blocks is that it adds indentation levels and the code for freeing can end up far away from the allocation code. Two issues solved in Swift with the defer keyword. Still a try block is a deterministic way to guarantee cleanup code is executed.

I'm proposing a 2 phase approach. First code a fix that minimizes the changes. Just simple changes that are easy to review. Fix the huge leaks for the normal flow. Get that merged. Then eventually refactor and cleanup the code so that it does not leak for the error cases.

I've posted a pull request addressing the issues ldwardx detailed. This is intended to be a stopgap fix suitable for a minor bug fix release.

This commit will:

  • Add a @try-@finally block to the while loop insuring the packet is always freed

  • Replace av_free by av_frame_free, the correct method to use to free an AVFrame

  • Add a call to sws_freeContext to free the SwsContext

  • Replace deprecated method avcodec_close with avcodec_free_context

  • Add a nullable annotation to the declaration of probeVideoInfoForFile to fix a build warning

Running a test where I first clear the cache by hand to force thumbnail generation and then open a video file the leaks command shows a significant reduction in memory leaks when the changes in the commit are applied:

Output from leaks before changes: Process: IINA [68560] Path: /Users/USER/Library/Developer/Xcode/DerivedData/iina-echacgeisxgbwucwumppkhklmnkd/Build/Products/Debug/IINA.app/Contents/MacOS/IINA Load Address: 0x103dcc000 Identifier: com.colliderli.iina Version: 1.2.0 (129) Code Type: X86-64 Platform: macOS Parent Process: debugserver [68561]

Date/Time: 2021-07-25 22:58:28.365 -0400
Launch Time: 2021-07-25 22:55:11.523 -0400
OS Version: macOS 11.4 (20F71)
Report Version: 7
Analysis Tool: /usr/bin/leaks

Physical footprint: 84.7M
Physical footprint (peak): 95.1M

leaks Report Version: 4.0
Process 68560: 101925 nodes malloced for 65076 KB
Process 68560: 697 leaks for 2409424 total leaked bytes.

697 (2.30M) << TOTAL >>

  5 (237K) ROOT LEAK: 0x7fc659652480 [32]
     2 (232K) 0x7fc65b87b280 [48]
        1 (232K) 0x7fc65f73a000 [237568]
     1 (5.00K) 0x7fc65a1c2400 [5120]
     1 (48 bytes) 0x7fc659651b40 [48]

  5 (234K) ROOT LEAK: 0x7fc65963ea80 [32]
     2 (232K) 0x7fc65b87bf00 [48]
        1 (232K) 0x7fc65f9fb000 [237568]
     1 (2.00K) 0x7fc65a1c1c00 [2048]
     1 (48 bytes) 0x7fc659629b80 [48]

  3 (232K) ROOT LEAK: 0x7fc659790d80 [32]
     1 (232K) 0x7fc65f77c000 [237568]
     1 (48 bytes) 0x7fc6597926c0 [48]

  58 (176K) ROOT LEAK: 0x7fc65f849000 [61440]
     21 (37.7K) 0x7fc6596414c0 [464]
        5 (6.38K) 0x7fc65962de00 [384]
           1 (1.50K) 0x7fc65a161400 [1536]
           1 (1.50K) 0x7fc65a161a00 [1536]
           1 (1.50K) 0x7fc65a162000 [1536]
           1 (1.50K) 0x7fc65a162600 [1536]
        5 (6.23K) 0x7fc65963de40 [240]
           1 (1.50K) 0x7fc65a163e00 [1536]
           1 (1.50K) 0x7fc65a166800 [1536]
           1 (1.50K) 0x7fc65a166e00 [1536]
           1 (1.50K) 0x7fc65a167400 [1536]
        1 (6.00K) 0x7fc65a108c00 [6144]
        1 (6.00K) 0x7fc65a10b000 [6144]
        1 (3.00K) 0x7fc65a10a400 [3072]
        1 (3.00K) 0x7fc65a14b000 [3072]
        1 (1.50K) 0x7fc65a167a00 [1536]
        1 (1.50K) 0x7fc65a168000 [1536]
        1 (1.50K) 0x7fc65a168600 [1536]
        1 (1.50K) 0x7fc65a168c00 [1536]
        1 (384 bytes) 0x7fc659641ac0 [384]
        1 (240 bytes) 0x7fc65961e280 [240]
     1 (24.0K) 0x7fc65a156200 [245
8000
76]
     1 (6.00K) 0x7fc65a15d800 [6144]
     1 (5.50K) 0x7fc65a15c200 [5632]
     1 (3.50K) 0x7fc65a147000 [3584]
     1 (3.00K) 0x7fc65a143600 [3072]
     1 (2.00K) 0x7fc65a07a000 [2048]
     1 (1.50K) 0x7fc65a10c800 [1536]
     1 (1.50K) 0x7fc65a10ce00 [1536]
     1 (1.50K) 0x7fc65a14bc00 [1536]
     1 (1.50K) 0x7fc65a15f000 [1536]
     1 (1.50K) 0x7fc65a15f600 [1536]
     1 (1.50K) 0x7fc65a15fc00 [1536]
     1 (1.50K) 0x7fc65a160200 [1536]
     1 (1.50K) 0x7fc65a160800 [1536]
     1 (1.50K) 0x7fc65a160e00 [1536]
     1 (1.50K) 0x7fc65a162c00 [1536]  length: 6  "$JxJ4J"
     1 (1.50K) 0x7fc65a163200 [1536]
     1 (1.50K) 0x7fc65a163800 [1536]
     1 (1.50K) 0x7fc65a164400 [1536]
     1 (1.50K) 0x7fc65a164a00 [1536]
     1 (1.50K) 0x7fc65a165000 [1536]
     1 (1.50K) 0x7fc65a165600 [1536]
     1 (1.50K) 0x7fc65a165c00 [1536]
     1 (1.50K) 0x7fc65a166200 [1536]
     1 (1.00K) 0x7fc65a0bac00 [1024]
     1 (1.00K) 0x7fc65a0cd200 [1024]
     1 (1.00K) 0x7fc65a0cd600 [1024]
     1 (1.00K) 0x7fc65a105c00 [1024]
     1 (1.00K) 0x7fc65a106000 [1024]
     1 (560 bytes) 0x7fc65964d400 [560]
     1 (560 bytes) 0x7fc65964d8c0 [560]
     1 (496 bytes) 0x7fc65961ec40 [496]
     4 (288 bytes) 0x7fc659629100 [128]
        1 (96 bytes) 0x7fc659642c80 [96]
        1 (32 bytes) 0x7fc659604ec0 [32]
        1 (32 bytes) 0x7fc65960bf00 [32]

  6 (19.2K) ROOT LEAK: 0x7fc659790ec0 [32]
     3 (17.6K) 0x7fc6597911c0 [32]
        1 (17.5K) 0x7fc65aa47800 [17920]
        1 (48 bytes) 0x7fc659791000 [48]
     1 (1.50K) 0x7fc65a9dea00 [1536]
     1 (48 bytes) 0x7fc659792540 [48]

  6 (18.7K) ROOT LEAK: 0x7fc65b87b940 [32]
     3 (16.6K) 0x7fc65b87bb00 [32]
        1 (16.5K) 0x7fc65b1b4a00 [16896]
        1 (48 bytes) 0x7fc65b86c700 [48]
     1 (2.00K) 0x7fc65b1ab600 [2048]
     1 (48 bytes) 0x7fc65b87c200 [48]

  4 (18.1K) ROOT LEAK: 0x7fc659790080 [32]
     1 (18.0K) 0x7fc65aa16e00 [18432]
     1 (48 bytes) 0x7fc6597900c0 [48]
     1 (48 bytes) 0x7fc659790100 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659455380 [32]
     1 (18.0K) 0x7fc6599ea800 [18432]
     1 (48 bytes) 0x7fc659492f00 [48]

  3 (18.1K) ROOT LEAK: 0x7fc65946bc40 [32]
     1 (18.0K) 0x7fc6599d8e00 [18432]
     1 (48 bytes) 0x7fc659445b80 [48]

  3 (18.1K) ROOT LEAK: 0x7fc65948d040 [32]
     1 (18.0K) 0x7fc6599e6000 [18432]
     1 (48 bytes) 0x7fc659455340 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659493800 [32]
     1 (18.0K) 0x7fc6599ef000 [18432]
     1 (48 bytes) 0x7fc659493740 [48]

  3 (18.1K) ROOT LEAK: 0x7fc65960bf40 [32]
     1 (18.0K) 0x7fc65a16b000 [18432]
     1 (48 bytes) 0x7fc659626cc0 [48]

  3 (18.1K) ROOT LEAK: 0x7fc65962c400 [32]
     1 (18.0K) 0x7fc65a17de00 [18432]
     1 (48 bytes) 0x7fc659627a40 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659645d40 [32]
     1 (18.0K) 0x7fc65a194c00 [18432]
     1 (48 bytes) 0x7fc65964bf80 [48]

  3 (18.1K) ROOT LEAK: 0x7fc65970d2c0 [32]
     1 (18.0K) 0x7fc65a9ae200 [18432]
     1 (48 bytes) 0x7fc65978f440 [48]

  3 (18.1K) ROOT LEAK: 0x7fc65972d5c0 [32]
     1 (18.0K) 0x7fc65a97a800 [18432]
     1 (48 bytes) 0x7fc65972d580 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659765640 [32]
     1 (18.0K) 0x7fc65a9bc600 [18432]
     1 (48 bytes) 0x7fc659791840 [48]

  3 (18.1K) ROOT LEAK: 0x7fc65977af40 [32]
     1 (18.0K) 0x7fc65a9a8800 [18432]
     1 (48 bytes) 0x7fc659765500 [48]

  3 (18.1K) ROOT LEAK: 0x7fc65977f680 [32]
     1 (18.0K) 0x7fc65a996600 [18432]
     1 (48 bytes) 0x7fc659790280 [48]

  3 (18.1K) ROOT LEAK: 0x7fc6597804c0 [32]
     1 (18.0K) 0x7fc65a97f000 [18432]
     1 (48 bytes) 0x7fc65972b7c0 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659788d40 [32]
     1 (18.0K) 0x7fc65a9b2a00 [18432]
     1 (48 bytes) 0x7fc659765540 [48]

  3 (18.1K) ROOT LEAK: 0x7fc65978f5c0 [32]
     1 (18.0K) 0x7fc65aa0c200 [18432]
     1 (48 bytes) 0x7fc65978ff80 [48]

  3 (18.1K) ROOT LEAK: 0x7fc65978fd40 [32]
     1 (18.0K) 0x7fc65aa03200 [18432]
     1 (48 bytes) 0x7fc65978fdc0 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659790040 [32]
     1 (18.0K) 0x7fc65a9d7c00 [18432]
     1 (48 bytes) 0x7fc659791240 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659790300 [32]
     1 (18.0K) 0x7fc65aa28a00 [18432]
     1 (48 bytes) 0x7fc659791400 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659790340 [32]
     1 (18.0K) 0x7fc65aa2f200 [18432]
     1 (48 bytes) 0x7fc6597919c0 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659791300 [32]
     1 (18.0K) 0x7fc65aa1b600 [18432]
     1 (48 bytes) 0x7fc6597925c0 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659791780 [32]
     1 (18.0K) 0x7fc65aa24000 [18432]
     1 (48 bytes) 0x7fc659791540 [48]

  3 (18.1K) ROOT LEAK: 0x7fc6597917c0 [32]
     1 (18.0K) 0x7fc65aa3ea00 [18432]
     1 (48 bytes) 0x7fc659791600 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659791800 [32]
     1 (18.0K) 0x7fc65a9c9e00 [18432]
     1 (48 bytes) 0x7fc659791140 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659791d00 [32]
     1 (18.0K) 0x7fc65aa07a00 [18432]
     1 (48 bytes) 0x7fc659791d80 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659791e80 [32]
     1 (18.0K) 0x7fc65aa10a00 [18432]
     1 (48 bytes) 0x7fc659791900 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659791f00 [32]
     1 (18.0K) 0x7fc65a9c0e00 [18432]
     1 (48 bytes) 0x7fc659792040 [48]

  3 (18.1K) ROOT LEAK: 0x7fc659792100 [32]
     1 (18.0K) 0x7fc65a9c5600 [18432]
     1 (48 bytes) 0x7fc659791280 [48]

  3 (18.1K) ROOT LEAK: 0x7fc65b845600 [32]
     1 (18.0K) 0x7fc65b199400 [18432]
     1 (48 bytes) 0x7fc65b839140 [48]

  3 (18.1K) ROOT LEAK: 0x7fc65b856cc0 [32]
     1 (18.0K) 0x7fc65b1ac000 [18432]
     1 (48 bytes) 0x7fc65b855e00 [48]

  3 (17.6K) ROOT LEAK: 0x7fc65978f900 [32]
     1 (17.5K) 0x7fc65aa56c00 [17920]
     1 (48 bytes) 0x7fc659792ac0 [48]

  3 (17.6K) ROOT LEAK: 0x7fc65978f980 [32]
     1 (17.5K) 0x7fc65aa63e00 [17920]
     1 (48 bytes) 0x7fc6597930c0 [48]

  3 (17.6K) ROOT LEAK: 0x7fc659790700 [32]
     1 (17.5K) 0x7fc65aa43200 [17920]
     1 (48 bytes) 0x7fc659790b80 [48]

  3 (17.6K) ROOT LEAK: 0x7fc6597910c0 [32]
     1 (17.5K) 0x7fc65aa6ca00 [17920]
     1 (48 bytes) 0x7fc6597938c0 [48]

  3 (17.6K) ROOT LEAK: 0x7fc659791100 [32]
     1 (17.5K) 0x7fc65aa71000 [17920]
     1 (48 bytes) 0x7fc659793900 [48]

  3 (17.6K) ROOT LEAK: 0x7fc659791200 [32]
     1 (17.5K) 0x7fc65aa4be00 [17920]
     1 (48 bytes) 0x7fc659790bc0 [48]

  3 (17.6K) ROOT LEAK: 0x7fc6597916c0 [32]
     1 (17.5K) 0x7fc65aa5b200 [17920]
     1 (48 bytes) 0x7fc659792b00 [48]

  3 (17.6K) ROOT LEAK: 0x7fc659791f40 [32]
     1 (17.5K) 0x7fc65aa5f800 [17920]
     1 (48 bytes) 0x7fc659792980 [48]

  3 (17.6K) ROOT LEAK: 0x7fc659791f80 [32]
     1 (17.5K) 0x7fc65aa68400 [17920]
     1 (48 bytes) 0x7fc659793100 [48]

  3 (17.6K) ROOT LEAK: 0x7fc659792000 [32]
     1 (17.5K) 0x7fc65aa75600 [17920]
     1 (48 bytes) 0x7fc6597939c0 [48]

  3 (17.6K) ROOT LEAK: 0x7fc6597927c0 [32]
     1 (17.5K) 0x7fc65aa79c00 [17920]
     1 (48 bytes) 0x7fc659792680 [48]

  5 (16.7K) ROOT LEAK: 0x7fc659610f40 [32]
     1 (16.5K) 0x7fc65a174a00 [16896]
     2 (160 bytes) 0x7fc65b868d40 [48]
        1 (112 bytes) 0x7fc65b856c40 [112]  length: 4  "ZTUM"
     1 (48 bytes) 0x7fc65964e100 [48]

  3 (16.6K) ROOT LEAK: 0x7fc659406940 [32]
     1 (16.5K) 0x7fc659822c00 [16896]
     1 (48 bytes) 0x7fc6594069c0 [48]

  3 (16.6K) ROOT LEAK: 0x7fc659406980 [32]
     1 (16.5K) 0x7fc659a19600 [16896]
     1 (48 bytes) 0x7fc6594935c0 [48]

  3 (16.6K) ROOT LEAK: 0x7fc659445a40 [32]
     1 (16.5K) 0x7fc659a1f000 [16896]
     1 (48 bytes) 0x7fc659492d00 [48]

  3 (16.6K) ROOT LEAK: 0x7fc6594930c0 [32]
     1 (16.5K) 0x7fc6599f3800 [16896]
     1 (48 bytes) 0x7fc659493440 [48]

  3 (16.6K) ROOT LEAK: 0x7fc659610fc0 [32]
     1 (16.5K) 0x7fc65a199400 [16896]
     1 (48 bytes) 0x7fc659620480 [48]

  3 (16.6K) ROOT LEAK: 0x7fc659727580 [32]
     1 (16.5K) 0x7fc65a9b7200 [16896]
     1 (48 bytes) 0x7fc65978cb00 [48]

  3 (16.6K) ROOT LEAK: 0x7fc65977a100 [32]
     1 (16.5K) 0x7fc65a99c000 [16896]
     1 (48 bytes) 0x7fc65978f600 [48]

  3 (16.6K) ROOT LEAK: 0x7fc6597870c0 [32]
     1 (16.5K) 0x7fc65a9a0200 [16896]
     1 (48 bytes) 0x7fc65978e400 [48]

  3 (16.6K) ROOT LEAK: 0x7fc65b853100 [32]
     1 (16.5K) 0x7fc65b1a4a00 [16896]
     1 (48 bytes) 0x7fc65b87bb80 [48]

  3 (16.6K) ROOT LEAK: 0x7fc65b86c7c0 [32]
     1 (16.5K) 0x7fc65b1d2000 [16896]
     1 (48 bytes) 0x7fc65b87b880 [48]

  3 (16.6K) ROOT LEAK: 0x7fc65b874cc0 [32]
     1 (16.5K) 0x7fc65b1d6200 [16896]
     1 (48 bytes) 0x7fc65b874d40 [48]

  3 (16.6K) ROOT LEAK: 0x7fc65b87bb40 [32]
     1 (16.5K) 0x7fc65b1b0800 [16896]
     1 (48 bytes) 0x7fc65b869e40 [48]

  3 (16.6K) ROOT LEAK: 0x7fc65b87bc00 [32]
     1 (16.5K) 0x7fc65b1c6c00 [16896]
     1 (48 bytes) 0x7fc65b87bd00 [48]

  3 (16.6K) ROOT LEAK: 0x7fc65b87bc40 [32]
     1 (16.5K) 0x7fc65b1cae00 [16896]
     1 (48 bytes) 0x7fc65b852f40 [48]

  3 (7.08K) ROOT LEAK: 0x7fc659629b00 [32]
     1 (7.00K) 0x7fc65a1d0c00 [7168]
     1 (48 bytes) 0x7fc659652f80 [48]

  3 (7.08K) ROOT LEAK: 0x7fc659629b40 [32]
     1 (7.00K) 0x7fc65a1d3e00 [7168]
     1 (48 bytes) 0x7fc659653400 [48]

  3 (7.08K) ROOT LEAK: 0x7fc65963e600 [32]
     1 (7.00K) 0x7fc65a1b2c00 [7168]
     1 (48 bytes) 0x7fc659629a80 [48]

  3 (7.08K) ROOT LEAK: 0x7fc65963e640 [32]
     1 (7.00K) 0x7fc65a1b1000 [7168]
     1 (48 bytes) 0x7fc6596299c0 [48]

  3 (7.08K) ROOT LEAK: 0x7fc659651a00 [32]
     1 (7.00K) 0x7fc65a1c6e00 [7168]
     1 (48 bytes) 0x7fc659651c80 [48]

  3 (7.08K) ROOT LEAK: 0x7fc659652500 [32]
     1 (7.00K) 0x7fc65a1c3800 [7168]
     1 (48 bytes) 0x7fc659650ec0 [48]

  3 (7.08K) ROOT LEAK: 0x7fc6596530c0 [32]
     1 (7.00K) 0x7fc65a1ca000 [7168]
     1 (48 bytes) 0x7fc6596518c0 [48]

  3 (7.08K) ROOT LEAK: 0x7fc6597041c0 [32]
     1 (7.00K) 0x7fc65a9f0200 [7168]
     1 (48 bytes) 0x7fc659790380 [48]

  3 (7.08K) ROOT LEAK: 0x7fc65977a5c0 [32]
     1 (7.00K) 0x7fc65a9e1a00 [7168]
     1 (48 bytes) 0x7fc659790580 [48]

  3 (7.08K) ROOT LEAK: 0x7fc65977b400 [32]
     1 (7.00K) 0x7fc65a9f3400 [7168]
     1 (48 bytes) 0x7fc6597913c0 [48]

  3 (7.08K) ROOT LEAK: 0x7fc65977e840 [32]
     1 (7.00K) 0x7fc65a9d4200 [7168]
     1 (48 bytes) 0x7fc659790ac0 [48]

  3 (7.08K) ROOT LEAK: 0x7fc659785580 [32]
     1 (7.00K) 0x7fc65a9ed000 [7168]
     1 (48 bytes) 0x7fc6597907c0 [48]

  3 (7.08K) ROOT LEAK: 0x7fc659786280 [32]
     1 (7.00K) 0x7fc65a994a00 [7168]
     1 (48 bytes) 0x7fc65978fa00 [48]

  3 (7.08K) ROOT LEAK: 0x7fc659786740 [32]
     1 (7.00K) 0x7fc65a9e6c00 [7168]
     1 (48 bytes) 0x7fc659790680 [48]

  3 (7.08K) ROOT LEAK: 0x7fc659787a40 [32]
     1 (7.00K) 0x7fc65a9e3600 [7168]
     1 (48 bytes) 0x7fc6597905c0 [48]

  3 (7.08K) ROOT LEAK: 0x7fc659788880 [32]
     1 (7.00K) 0x7fc65a9e9e00 [7168]
     1 (48 bytes) 0x7fc65978f500 [48]

  3 (7.08K) ROOT LEAK: 0x7fc65978c440 [32]
     1 (7.00K) 0x7fc65a9dfe00 [7168]
     1 (48 bytes) 0x7fc65978fb80 [48]

  3 (7.08K) ROOT LEAK: 0x7fc65978cec0 [32]
     1 (7.00K) 0x7fc65a9f6600 [7168]
     1 (48 bytes) 0x7fc6597901c0 [48]

  3 (5.08K) ROOT LEAK: 0x7fc659493500 [32]
     1 (5.00K) 0x7fc6599d6e00 [5120]
     1 (48 bytes) 0x7fc659493b40 [48]

  3 (5.08K) ROOT LEAK: 0x7fc659493580 [32]
     1 (5.00K) 0x7fc659a0c800 [5120]
     1 (48 bytes) 0x7fc659493b80 [48]

  3 (5.08K) ROOT LEAK: 0x7fc6594936c0 [32]
     1 (5.00K) 0x7fc659a1d800 [5120]
     1 (48 bytes) 0x7fc6594934c0 [48]

  3 (5.08K) ROOT LEAK: 0x7fc6594937c0 [32]
     1 (5.00K) 0x7fc659a10200 [5120]
     1 (48 bytes) 0x7fc659492d40 [48]

  3 (5.08K) ROOT LEAK: 0x7fc659620440 [32]
     1 (5.00K) 0x7fc65a1b5e00 [5120]
     1 (48 bytes) 0x7fc659650d40 [48]

  3 (5.08K) ROOT LEAK: 0x7fc659652100 [32]
     1 (5.00K) 0x7fc65a1b7e00 [5120]
     1 (48 bytes) 0x7fc659613f80 [48]

  3 (5.08K) ROOT LEAK: 0x7fc659652440 [32]
     1 (5.00K) 0x7fc65a1afc00 [5120]
     1 (48 bytes) 0x7fc659651d40 [48]

  3 (5.08K) ROOT LEAK: 0x7fc659783dc0 [32]
     1 (5.00K) 0x7fc65a970a00 [5120]
     1 (48 bytes) 0x7fc65978f8c0 [48]

  3 (5.08K) ROOT LEAK: 0x7fc659785dc0 [32]
     1 (5.00K) 0x7fc65a983800 [5120]
     1 (48 bytes) 0x7fc65978f840 [48]

  3 (5.08K) ROOT LEAK: 0x7fc65978a9c0 [32]
     1 (5.00K) 0x7fc65a9a5c00 [5120]
     1 (48 bytes) 0x7fc659790540 [48]

  3 (5.08K) ROOT LEAK: 0x7fc65b835340 [32]
     1 (5.00K) 0x7fc65b015a00 [5120]
     1 (48 bytes) 0x7fc65b852ec0 [48]

  3 (5.08K) ROOT LEAK: 0x7fc65b86c680 [32]
     1 (5.00K) 0x7fc65b1e7600 [5120]
     1 (48 bytes) 0x7fc65b87b400 [48]

  3 (5.08K) ROOT LEAK: 0x7fc65b874d00 [32]
     1 (5.00K) 0x7fc65b19dc00 [5120]
     1 (48 bytes) 0x7fc65b87b680 [48]

  3 (5.08K) ROOT LEAK: 0x7fc65b87b480 [32]
     1 (5.00K) 0x7fc65b1aa000 [5120]
     1 (48 bytes) 0x7fc65b853c40 [48]

  3 (5.08K) ROOT LEAK: 0x7fc65b87b740 [32]
     1 (5.00K) 0x7fc65b1a8c00 [5120]
     1 (48 bytes) 0x7fc65b853b80 [48]

  3 (4.58K) ROOT LEAK: 0x7fc659629ac0 [32]
     1 (4.50K) 0x7fc65a1d5e00 [4608]
     1 (48 bytes) 0x7fc659629a00 [48]

  3 (4.58K) ROOT LEAK: 0x7fc65963e5c0 [32]
     1 (4.50K) 0x7fc65a1cfa00 [4608]
     1 (48 bytes) 0x7fc65963e500 [48]

  3 (4.58K) ROOT LEAK: 0x7fc65963eac0 [32]
     1 (4.50K) 0x7fc65a1c8e00 [4608]
     1 (48 bytes) 0x7fc65963e580 [48]

  3 (4.58K) ROOT LEAK: 0x7fc659650f40 [32]
     1 (4.50K) 0x7fc65a1d9000 [4608]
     1 (48 bytes) 0x7fc659650f00 [48]

  3 (4.58K) ROOT LEAK: 0x7fc659650f80 [32]
     1 (4.50K) 0x7fc65a1dc200 [4608]
     1 (48 bytes) 0x7fc659652580 [48]

  3 (4.58K) ROOT LEAK: 0x7fc6596519c0 [32]
     1 (4.50K) 0x7fc65a1ae200 [4608]
     1 (48 bytes) 0x7fc659642400 [48]

  3 (4.58K) ROOT LEAK: 0x7fc659653080 [32]
     1 (4.50K) 0x7fc65a1d2c00 [4608]
     1 (48 bytes) 0x7fc659651cc0 [48]

  3 (4.58K) ROOT LEAK: 0x7fc6597231c0 [32]
     1 (4.50K) 0x7fc65a9e5a00 [4608]
     1 (48 bytes) 0x7fc65978fa40 [48]

  3 (4.58K) ROOT LEAK: 0x7fc659734800 [32]
     1 (4.50K) 0x7fc65a9ef000 [4608]
     1 (48 bytes) 0x7fc6597904c0 [48]

  3 (4.58K) ROOT LEAK: 0x7fc659766d40 [32]
     1 (4.50K) 0x7fc65a9d6a00 [4608]
     1 (48 bytes) 0x7fc65978fd00 [48]

  3 (4.58K) ROOT LEAK: 0x7fc659779780 [32]
     1 (4.50K) 0x7fc65a9f8600 [4608]
     1 (48 bytes) 0x7fc659790800 [48]

  3 (4.58K) ROOT LEAK: 0x7fc65977da00 [32]
     1 (4.50K) 0x7fc65a9ebe00 [4608]
     1 (48 bytes) 0x7fc6597655c0 [48]

  3 (4.58K) ROOT LEAK: 0x7fc659782140 [32]
     1 (4.50K) 0x7fc65a9fb800 [4608]
     1 (48 bytes) 0x7fc659791700 [48]

  3 (4.58K) ROOT LEAK: 0x7fc659782f80 [32]
     1 (4.50K) 0x7fc65a9e8c00 [4608]
     1 (48 bytes) 0x7fc659790480 [48]

  3 (4.58K) ROOT LEAK: 0x7fc659786c00 [32]
     1 (4.50K) 0x7fc65a9f5400 [4608]
     1 (48 bytes) 0x7fc65978f480 [48]

  3 (4.58K) ROOT LEAK: 0x7fc659787f00 [32]
     1 (4.50K) 0x7fc65a9d3000 [4608]
     1 (48 bytes) 0x7fc659765580 [48]

  3 (4.58K) ROOT LEAK: 0x7fc6597883c0 [32]
     1 (4.50K) 0x7fc65a9f2200 [4608]
     1 (48 bytes) 0x7fc659790600 [48]

  3 (4.58K) ROOT LEAK: 0x7fc65978fc40 [32]
     1 (4.50K) 0x7fc65a9fea00 [4608]
     1 (48 bytes) 0x7fc65978fa80 [48]

  3 (2.58K) ROOT LEAK: 0x7fc65978f9c0 [32]
     1 (2.50K) 0x7fc65aa50e00 [2560]
     1 (48 bytes) 0x7fc6597929c0 [48]

  3 (2.58K) ROOT LEAK: 0x7fc659790f40 [32]
     1 (2.50K) 0x7fc65aa52200 [2560]
     1 (48 bytes) 0x7fc659790f00 [48]

  3 (2.58K) ROOT LEAK: 0x7fc659791080 [32]
     1 (2.50K) 0x7fc65aa51800 [2560]
     1 (48 bytes) 0x7fc659791040 [48]

  3 (2.58K) ROOT LEAK: 0x7fc659791180 [32]
     1 (2.50K) 0x7fc65aa56200 [2560]
     1 (48 bytes) 0x7fc659790740 [48]

  3 (2.58K) ROOT LEAK: 0x7fc6597914c0 [32]
     1 (2.50K) 0x7fc65aa2e200 [2560]
     1 (48 bytes) 0x7fc659790b00 [48]

  3 (2.58K) ROOT LEAK: 0x7fc659791500 [32]
     1 (2.50K) 0x7fc65aa50400 [2560]
     1 (48 bytes) 0x7fc65978f940 [48]

  3 (2.58K) ROOT LEAK: 0x7fc659791580 [32]
     1 (2.50K) 0x7fc65aa53400 [2560]
     1 (48 bytes) 0x7fc659791440 [48]

  3 (2.58K) ROOT LEAK: 0x7fc6597915c0 [32]
     1 (2.50K) 0x7fc65aa53e00 [2560]
     1 (48 bytes) 0x7fc659791480 [48]

  3 (2.58K) ROOT LEAK: 0x7fc659791680 [32]
     1 (2.50K) 0x7fc65aa55800 [2560]
     1 (48 bytes) 0x7fc659791640 [48]

  3 (2.58K) ROOT LEAK: 0x7fc659791fc0 [32]
     1 (2.50K) 0x7fc65aa84000 [2560]
     1 (48 bytes) 0x7fc659792a00 [48]

  3 (2.58K) ROOT LEAK: 0x7fc659792780 [32]
     1 (2.50K) 0x7fc65aa81200 [2560]
     1 (48 bytes) 0x7fc659790f80 [48]

  3 (2.58K) ROOT LEAK: 0x7fc659792a40 [32]
     1 (2.50K) 0x7fc65aa81c00 [2560]
     1 (48 bytes) 0x7fc659792880 [48]

  4 (2.12K) ROOT LEAK: 0x7fc659614000 [32]
     1 (2.00K) 0x7fc65a1bfa00 [2048]
     1 (48 bytes) 0x7fc659651d80 [48]
     1 (48 bytes) 0x7fc65b87ac00 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659406900 [32]
     1 (2.00K) 0x7fc659813200 [2048]
     1 (48 bytes) 0x7fc659445a80 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659406a40 [32]
     1 (2.00K) 0x7fc6599dd600 [2048]
     1 (48 bytes) 0x7fc659406a00 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659445b40 [32]
     1 (2.00K) 0x7fc659a0de00 [2048]
     1 (48 bytes) 0x7fc659492cc0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65948de40 [32]
     1 (2.00K) 0x7fc6599de200 [2048]
     1 (48 bytes) 0x7fc65946bc00 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659493140 [32]
     1 (2.00K) 0x7fc65985fc00 [2048]
     1 (48 bytes) 0x7fc659493100 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659493540 [32]
     1 (2.00K) 0x7fc659a0c000 [2048]
     1 (48 bytes) 0x7fc659494240 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659493680 [32]
     1 (2.00K) 0x7fc659a0e600 [2048]
     1 (48 bytes) 0x7fc659493640 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659493700 [32]
     1 (2.00K) 0x7fc659902600 [2048]
     1 (48 bytes) 0x7fc6594459c0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659493780 [32]
     1 (2.00K) 0x7fc6599d8200 [2048]
     1 (48 bytes) 0x7fc659493840 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659494400 [32]
     1 (2.00K) 0x7fc659a0ee00 [2048]
     1 (48 bytes) 0x7fc659494100 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659610f80 [32]
     1 (2.00K) 0x7fc65a17ac00 [2048]
     1 (48 bytes) 0x7fc65964e080 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65962c480 [32]
     1 (2.00K) 0x7fc65a16a200 [2048]
     1 (48 bytes) 0x7fc65962c440 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65962dbc0 [32]
     1 (2.00K) 0x7fc65a17ca00 [2048]
     1 (48 bytes) 0x7fc659613fc0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659638a80 [32]
     1 (2.00K) 0x7fc65a145e00 [2048]
     1 (48 bytes) 0x7fc6596279c0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65963f480 [32]
     1 (2.00K) 0x7fc65a17a400 [2048]
     1 (48 bytes) 0x7fc65962a840 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659642300 [32]
     1 (2.00K) 0x7fc65a179600 [2048]
     1 (48 bytes) 0x7fc6596444c0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659642380 [32]
     1 (2.00K) 0x7fc65a1af400 [2048]
     1 (48 bytes) 0x7fc659652080 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659642d00 [32]
     1 (2.00K) 0x7fc65a146600 [2048]
     1 (48 bytes) 0x7fc659651500 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659652400 [32]
     1 (2.00K) 0x7fc65a17d400 [2048]
     1 (48 bytes) 0x7fc6596523c0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc6596524c0 [32]
     1 (2.00K) 0x7fc65a1c6600 [2048]
     1 (48 bytes) 0x7fc6596423c0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65972b840 [32]
     1 (2.00K) 0x7fc65a9ada00 [2048]
     1 (48 bytes) 0x7fc65978c080 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659766f40 [32]
     1 (2.00K) 0x7fc65a977400 [2048]
     1 (48 bytes) 0x7fc65978e740 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65977aa80 [32]
     1 (2.00K) 0x7fc65a9a5400 [2048]
     1 (48 bytes) 0x7fc65978f800 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65977d080 [32]
     1 (2.00K) 0x7fc65a970200 [2048]
     1 (48 bytes) 0x7fc659724fc0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65977d540 [32]
     1 (2.00K) 0x7fc65a9a7c00 [2048]
     1 (48 bytes) 0x7fc65978e780 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65977e380 [32]
     1 (2.00K) 0x7fc65a977c00 [2048]
     1 (48 bytes) 0x7fc659724f00 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65977f1c0 [32]
     1 (2.00K) 0x7fc65a9a4a00 [2048]
     1 (48 bytes) 0x7fc65978e440 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65977fb40 [32]
     1 (2.00K) 0x7fc65a9bb400 [2048]
     1 (48 bytes) 0x7fc65978e7c0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659780000 [32]
     1 (2.00K) 0x7fc65a99ae00 [2048]
     1 (48 bytes) 0x7fc65978fb00 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659780980 [32]
     1 (2.00K) 0x7fc65a973c00 [2048]
     1 (48 bytes) 0x7fc65978c0c0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659781c80 [32]
     1 (2.00K) 0x7fc65a974800 [2048]
     1 (48 bytes) 0x7fc65978f680 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659782ac0 [32]
     1 (2.00K) 0x7fc65a972000 [2048]
     1 (48 bytes) 0x7fc65978e240 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659783900 [32]
     1 (2.00K) 0x7fc65a9a7000 [2048]
     1 (48 bytes) 0x7fc65978e380 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659784740 [32]
     1 (2.00K) 0x7fc65a9ad000 [2048]
     1 (48 bytes) 0x7fc65978e2c0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659787580 [32]
     1 (2.00K) 0x7fc65a99b600 [2048]
     1 (48 bytes) 0x7fc65978fc00 [48]

  3 (2.08K) ROOT LEAK: 0x7fc6597896c0 [32]
     1 (2.00K) 0x7fc65a984c00 [2048]
     1 (48 bytes) 0x7fc65978fb40 [48]

  3 (2.08K) ROOT LEAK: 0x7fc659789b80 [32]
     1 (2.00K) 0x7fc65a98b800 [2048]
     1 (48 bytes) 0x7fc65978e280 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65978b580 [32]
     1 (2.00K) 0x7fc65a9bbe00 [2048]
     1 (48 bytes) 0x7fc65978e340 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65b848300 [32]
     1 (2.00K) 0x7fc65b17bc00 [2048]
     1 (48 bytes) 0x7fc65b86c740 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65b853180 [32]
     1 (2.00K) 0x7fc65b19fc00 [2048]
     1 (48 bytes) 0x7fc65b853140 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65b856980 [32]
     1 (2.00K) 0x7fc65b17d400 [2048]
     1 (48 bytes) 0x7fc65b855dc0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65b85d500 [32]
     1 (2.00K) 0x7fc65b016e00 [2048]
     1 (48 bytes) 0x7fc65b87b500 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65b86c6c0 [32]
     1 (2.00K) 0x7fc65b17c400 [2048]
     1 (48 bytes) 0x7fc65b87b8c0 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65b87a100 [32]
     1 (2.00K) 0x7fc65b17b400 [2048]
     1 (48 bytes) 0x7fc65b87a580 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65b87b440 [32]
     1 (2.00K) 0x7fc65b1c6000 [2048]
     1 (48 bytes) 0x7fc65b87b380 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65b87b980 [32]
     1 (2.00K) 0x7fc65b1e8a00 [2048]
     1 (48 bytes) 0x7fc65b87b800 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65b87bbc0 [32]
     1 (2.00K) 0x7fc65b017600 [2048]
     1 (48 bytes) 0x7fc65b87bf40 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65b87bcc0 [32]
     1 (2.00K) 0x7fc65b1a0800 [2048]
     1 (48 bytes) 0x7fc65b87bc80 [48]

  3 (2.08K) ROOT LEAK: 0x7fc65b87c280 [32]
     1 (2.00K) 0x7fc65b17cc00 [2048]
     1 (48 bytes) 0x7fc65b87ba80 [48]

  2 (1.61K) ROOT LEAK: 0x7fc65a0b5e00 [1536]
     1 (112 bytes) 0x7fc659616000 [112]

  3 (1.58K) ROOT LEAK: 0x7fc659777b00 [32]
     1 (1.50K) 0x7fc65a9e5200 [1536]
     1 (48 bytes) 0x7fc6597903c0 [48]

  3 (1.58K) ROOT LEAK: 0x7fc65978f580 [32]
     1 (1.50K) 0x7fc65aa01c00 [1536]
     1 (48 bytes) 0x7fc65978f540 [48]

  3 (1.58K) ROOT LEAK: 0x7fc65978fd80 [32]
     1 (1.50K) 0x7fc65aa16800 [1536]
     1 (48 bytes) 0x7fc659790400 [48]

  3 (1.58K) ROOT LEAK: 0x7fc65978fe40 [32]
     1 (1.50K) 0x7fc65a9fae00 [1536]
     1 (48 bytes) 0x7fc65978fe00 [48]

  3 (1.58K) ROOT LEAK: 0x7fc65978fe80 [32]
     1 (1.50K) 0x7fc65a9d2200 [1536]
     1 (48 bytes) 0x7fc659792080 [48]

  3 (1.58K) ROOT LEAK: 0x7fc65978fec0 [32]
     1 (1.50K) 0x7fc65aa02c00 [1536]
     1 (48 bytes) 0x7fc659790200 [48]

  3 (1.58K) ROOT LEAK: 0x7fc65978ffc0 [32]
     1 (1.50K) 0x7fc65aa37600 [1536]
     1 (48 bytes) 0x7fc659791880 [48]

  3 (1.58K) ROOT LEAK: 0x7fc6597902c0 [32]
     1 (1.50K) 0x7fc65aa16200 [1536]
     1 (48 bytes) 0x7fc65978ff00 [48]

  3 (1.58K) ROOT LEAK: 0x7fc659790e80 [32]
     1 (1.50K) 0x7fc65a9de400 [1536]
     1 (48 bytes) 0x7fc659791940 [48]

  3 (1.58K) ROOT LEAK: 0x7fc659791740 [32]
     1 (1.50K) 0x7fc65aa23a00 [1536]
     1 (48 bytes) 0x7fc659791340 [48]

  3 (1.58K) ROOT LEAK: 0x7fc659791a40 [32]
     1 (1.50K) 0x7fc65a9fa800 [1536]
     1 (48 bytes) 0x7fc659791a00 [48]

  3 (1.58K) ROOT LEAK: 0x7fc659791d40 [32]
     1 (1.50K) 0x7fc65a9d2a00 [1536]
     1 (48 bytes) 0x7fc65978fc80 [48]

  3 (1.58K) ROOT LEAK: 0x7fc659791ec0 [32]
     1 (1.50K) 0x7fc65a9df800 [1536]
     1 (48 bytes) 0x7fc659791dc0 [48]

  3 (1.58K) ROOT LEAK: 0x7fc659792140 [32]
     1 (1.50K) 0x7fc65a9df200 [1536]
     1 (48 bytes) 0x7fc659790140 [48]

  3 (1.58K) ROOT LEAK: 0x7fc659792500 [32]
     1 (1.50K) 0x7fc65aa3e400 [1536]
     1 (48 bytes) 0x7fc6597924c0 [48]

  2 (1.53K) ROOT LEAK: 0x7fc659791e40 [32]
     1 (1.50K) 0x7fc65aa02200 [1536]

  5 (1.27K) ROOT LEAK: <MenuController 0x7fc65b80c4b0> [928]
     4 (368 bytes) menuBindingList --> <Swift._DictionaryStorage<__C.NSMenu, (__C.NSMenuItem) -> Swift.Bool> 0x7fc65960e1f0> [272]
        1 (32 bytes) <Swift closure context 0x60000350b6c0> [32]
        1 (32 bytes) <Swift closure context 0x60000350b740> [32]
        1 (32 bytes) <Swift closure context 0x60000350b980> [32]

  6 (400 bytes) ROOT CYCLE: <Swift closure context 0x6000035f2f40> [32]
     1 (32 bytes) __strong  --> ROOT CYCLE: <Swift closure context 0x6000035f30a0> [32]
         + 8 --> CYCLE BACK TO <Swift closure context 0x6000035f2f40> [32]
     4 (336 bytes) __strong  --> <Swift closure context 0x6000035f2d60> [32]
        3 (304 bytes)  --> <Swift._DictionaryStorage<Swift.String, Swift.Array<IINA.FileInfo>> 0x60000025b2e0> [176]
           1 (64 bytes) <Swift._ContiguousArrayStorage<IINA.FileInfo> 0x6000020a2780> [64]
           1 (64 bytes) <Swift._ContiguousArrayStorage<IINA.FileInfo> 0x6000020a2b40> [64]

  5 (272 bytes) ROOT CYCLE: <Swift closure context 0x6000035eee00> [32]
     1 (32 bytes) __strong  --> ROOT CYCLE: <Swift closure context 0x6000035eee20> [32]
         + 8 --> CYCLE BACK TO <Swift closure context 0x6000035eee00> [32]
     3 (208 bytes) __strong  --> <Swift closure context 0x6000035ef280> [32]
        2 (176 bytes)  --> <Swift._DictionaryStorage<Swift.String, Swift.Array<IINA.FileInfo>> 0x600001b16e00> [128]
           1 (48 bytes) <Swift._ContiguousArrayStorage<IINA.FileInfo> 0x600003a6d470> [48]

  4 (160 bytes) ROOT LEAK: 0x7fc659790d40 [32]
     2 (80 bytes) 0x7fc659790dc0 [32]
        1 (48 bytes) 0x7fc659792700 [48]
     1 (48 bytes) 0x7fc659793940 [48]

  2 (144 bytes) ROOT CYCLE: 0x60000160a9e0 [80]
     CYCLE BACK TO 0x60000160a9e0 [80]
     1 (64 bytes) ROOT CYCLE: 0x6000020fcdc0 [64]
        CYCLE BACK TO 0x60000160a9e0 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000016764e0 [80]
     CYCLE BACK TO 0x6000016764e0 [80]
     1 (64 bytes) ROOT CYCLE: 0x6000020a9900 [64]
        CYCLE BACK TO 0x6000016764e0 [80]

  2 (144 bytes) ROOT CYCLE: 0x600001676710 [80]
     CYCLE BACK TO 0x600001676710 [80]
     1 (64 bytes) ROOT CYCLE: 0x6000020a97c0 [64]
        CYCLE BACK TO 0x600001676710 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000016cabc0 [80]
     CYCLE BACK TO 0x6000016cabc0 [80]
     1 (64 bytes) ROOT CYCLE: 0x600002f41080 [64]
        CYCLE BACK TO 0x6000016cabc0 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000016cc1e0 [80]
     CYCLE BACK TO 0x6000016cc1e0 [80]
     1 (64 bytes) ROOT CYCLE: 0x6000020af080 [64]
        CYCLE BACK TO 0x6000016cc1e0 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000016cc230 [80]
     CYCLE BACK TO 0x6000016cc230 [80]
     1 (64 bytes) ROOT CYCLE: 0x6000020af180 [64]
        CYCLE BACK TO 0x6000016cc230 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000016cc320 [80]
     CYCLE BACK TO 0x6000016cc320 [80]
     1 (64 bytes) ROOT CYCLE: 0x6000020aef00 [64]
        CYCLE BACK TO 0x6000016cc320 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000016cc370 [80]
     CYCLE BACK TO 0x6000016cc370 [80]
     1 (64 bytes) ROOT CYCLE: 0x6000020af000 [64]
        CYCLE BACK TO 0x6000016cc370 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000016cc3c0 [80]
     CYCLE BACK TO 0x6000016cc3c0 [80]
     1 (64 bytes) ROOT CYCLE: 0x6000020aee80 [64]
        CYCLE BACK TO 0x6000016cc3c0 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000016cc410 [80]
     CYCLE BACK TO 0x6000016cc410 [80]
     1 (64 bytes) ROOT CYCLE: 0x6000020aed80 [64]
        CYCLE BACK TO 0x6000016cc410 [80]

  2 (80 bytes) ROOT LEAK: 0x7fc6596402c0 [32]
     1 (48 bytes) 0x7fc659652540 [48]

  2 (80 bytes) ROOT LEAK: 0x7fc659645dc0 [32]
     1 (48 bytes) 0x7fc6596422c0 [48]

  2 (80 bytes) ROOT LEAK: 0x7fc65964b400 [32]
     1 (48 bytes) 0x7fc659646100 [48]

  2 (80 bytes) ROOT LEAK: 0x7fc65977ed00 [32]
     1 (48 bytes) 0x7fc6597654c0 [48]

  1 (64 bytes) ROOT LEAK: 0x600002f62a00 [64]
  1 (32 bytes) ROOT LEAK: 0x7fc659445b00 [32]
  1 (32 bytes) ROOT LEAK: 0x7fc65963eb00 [32]
  1 (32 bytes) ROOT LEAK: 0x7fc659642340 [32]
  1 (32 bytes) ROOT LEAK: 0x7fc659644a80 [32]
  1 (32 bytes) ROOT LEAK: 0x7fc65977dec0 [32]
Output from leaks after changes: Process: IINA [68883] Path: /Users/USER/Library/Developer/Xcode/DerivedData/iina-echacgeisxgbwucwumppkhklmnkd/Build/Products/Debug/IINA.app/Contents/MacOS/IINA Load Address: 0x105a9b000 Identifier: com.colliderli.iina Version: 1.2.0 (129) Code Type: X86-64 Platform: macOS Parent Process: debugserver [68885]

Date/Time: 2021-07-25 23:01:25.465 -0400
Launch Time: 2021-07-25 22:59:47.056 -0400
OS Version: macOS 11.4 (20F71)
Report Version: 7
Analysis Tool: /usr/bin/leaks

Physical footprint: 88.2M
Physical footprint (peak): 91.9M

leaks Report Version: 4.0
Process 68883: 101468 nodes malloced for 63928 KB
Process 68883: 58 leaks for 4944 total leaked bytes.

58 (4.83K) << TOTAL >>

  6 (1.30K) ROOT LEAK: <MenuController 0x7fde4540f1f0> [928]
     5 (400 bytes) menuBindingList --> <Swift._DictionaryStorage<__C.NSMenu, (__C.NSMenuItem) -> Swift.Bool> 0x7fde4700d7c0> [272]
        1 (32 bytes) <Swift closure context 0x600002a0ae20> [32]
        1 (32 bytes) <Swift closure context 0x600002a70a40> [32]
        1 (32 bytes) <Swift closure context 0x600002a70c60> [32]
        1 (32 bytes) <Swift closure context 0x600002a70ce0> [32]

  7 (448 bytes) ROOT CYCLE: <Swift closure context 0x600002af5e40> [32]
     6 (416 bytes)  + 8 --> ROOT CYCLE: <Swift closure context 0x600002af5e60> [32]
        __strong  --> CYCLE BACK TO <Swift closure context 0x600002af5e40> [32]
        5 (384 bytes) __strong  --> <Swift closure context 0x600002af5e20> [32]
           4 (352 bytes)  --> <Swift._DictionaryStorage<Swift.String, Swift.Array<IINA.FileInfo>> 0x600001d32e10> [176]
              1 (64 bytes) <Swift._ContiguousArrayStorage<IINA.FileInfo> 0x600003f0fd00> [64]
              1 (64 bytes) <Swift._ContiguousArrayStorage<IINA.FileInfo> 0x600003f0fdc0> [64]
              1 (48 bytes) <Swift._ContiguousArrayStorage<IINA.FileInfo> 0x6000025180f0> [48]

  4 (224 bytes) ROOT CYCLE: <Swift closure context 0x600002af5f00> [32]
     3 (192 bytes)  + 8 --> ROOT CYCLE: <Swift closure context 0x600002af5f20> [32]
        __strong  --> CYCLE BACK TO <Swift closure context 0x600002af5f00> [32]
        2 (160 bytes) __strong  --> <Swift closure context 0x600002af5ee0> [32]
           1 (128 bytes)  --> <Swift._DictionaryStorage<Swift.String, Swift.Array<IINA.FileInfo>> 0x600000440680> [128]

  2 (144 bytes) ROOT CYCLE: 0x600000901a40 [80]
     CYCLE BACK TO 0x600000901a40 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f99ac0 [64]
        CYCLE BACK TO 0x600000901a40 [80]

  2 (144 bytes) ROOT CYCLE: 0x600000904280 [80]
     CYCLE BACK TO 0x600000904280 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f88a80 [64]
        CYCLE BACK TO 0x600000904280 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009043c0 [80]
     CYCLE BACK TO 0x6000009043c0 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f88680 [64]
        CYCLE BACK TO 0x6000009043c0 [80]

  2 (144 bytes) ROOT CYCLE: 0x600000904460 [80]
     CYCLE BACK TO 0x600000904460 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f88780 [64]
        CYCLE BACK TO 0x600000904460 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009044b0 [80]
     CYCLE BACK TO 0x6000009044b0 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f88900 [64]
        CYCLE BACK TO 0x6000009044b0 [80]

  2 (144 bytes) ROOT CYCLE: 0x600000904500 [80]
     CYCLE BACK TO 0x600000904500 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f88880 [64]
        CYCLE BACK TO 0x600000904500 [80]

  2 (144 bytes) ROOT CYCLE: 0x600000904550 [80]
     CYCLE BACK TO 0x600000904550 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f88800 [64]
        CYCLE BACK TO 0x600000904550 [80]

  2 (144 bytes) ROOT CYCLE: 0x600000904640 [80]
     CYCLE BACK TO 0x600000904640 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f88980 [64]
        CYCLE BACK TO 0x600000904640 [80]

  2 (144 bytes) ROOT CYCLE: 0x600000950690 [80]
     CYCLE BACK TO 0x600000950690 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f89ec0 [64]
        CYCLE BACK TO 0x600000950690 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009506e0 [80]
     CYCLE BACK TO 0x6000009506e0 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f88000 [64]
        CYCLE BACK TO 0x6000009506e0 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009bf9d0 [80]
     CYCLE BACK TO 0x6000009bf9d0 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f831c0 [64]
        CYCLE BACK TO 0x6000009bf9d0 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009bfa70 [80]
     CYCLE BACK TO 0x6000009bfa70 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f83bc0 [64]
        CYCLE BACK TO 0x6000009bfa70 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009bfc00 [80]
     CYCLE BACK TO 0x6000009bfc00 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f83340 [64]
        CYCLE BACK TO 0x6000009bfc00 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009bfc50 [80]
     CYCLE BACK TO 0x6000009bfc50 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f82f80 [64]
        CYCLE BACK TO 0x6000009bfc50 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009bfcf0 [80]
     CYCLE BACK TO 0x6000009bfcf0 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f82a00 [64]
        CYCLE BACK TO 0x6000009bfcf0 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009bfd40 [80]
     CYCLE BACK TO 0x6000009bfd40 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f82400 [64]
        CYCLE BACK TO 0x6000009bfd40 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009bfde0 [80]
     CYCLE BACK TO 0x6000009bfde0 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f80ac0 [64]
        CYCLE BACK TO 0x6000009bfde0 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009bfe30 [80]
     CYCLE BACK TO 0x6000009bfe30 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f82840 [64]
        CYCLE BACK TO 0x6000009bfe30 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009bfe80 [80]
     CYCLE BACK TO 0x6000009bfe80 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f81a80 [64]
        CYCLE BACK TO 0x6000009bfe80 [80]

  2 (144 bytes) ROOT CYCLE: 0x6000009bff20 [80]
     CYCLE BACK TO 0x6000009bff20 [80]
     1 (64 bytes) ROOT CYCLE: 0x600003f81ec0 [64]
        CYCLE BACK TO 0x6000009bff20 [80]

  1 (64 bytes) ROOT LEAK: 0x60000303fd40 [64]

Thoughts? Critical reviews welcome.

Of course additional changes will be required to make FFmpegController leakproof.

logchan added a commit to logchan/iina that referenced this issue Oct 27, 2021
Fix memory leaks in FFmpegController, iina#1720
lhc70000 added a commit that referenced this issue Apr 28, 2022
commit d0c32125df2269621f0b6a85dabe36120a6d3f3b
Merge: fea9399 a6b600d
Author: Collider LI <lhc199652@gmail.com>
Date:   Thu Apr 28 02:12:43 2022 -0400

    Merge branch 'issue-1720' of https://github.com/low-batt/iina into low-batt-issue-1720

commit a6b600d
Author: low-batt <86170219+low-batt@users.noreply.github.com>
Date:   Sun Jul 25 23:14:05 2021 -0400

    Fix memory leaks in FFmpegController, #1720

    The method `getPeeksForFile` in `FFmpegController` is leaking memory
    when generating thumbnails. This commit will:

    - Add a `@try-@finally` block in the while loop to free the packet

    - Replace `av_free` by `av_frame_free`, when freeing an `AVFrame`

    - Add a call to `sws_freeContext` to free the `SwsContext`

    - Replace deprecated method `avcodec_close` with `avcodec_free_context`

    - Add `nullable` annotation to declaration of `probeVideoInfoForFile`

    This is a stopgap fix and does not address all of the potential leaks
    in the method. This commit focuses on the leaks that occur during the
    normal flow when generating thumbnails. Error flows will still leak
    memory. At some point this method should be refactored to always
    properly free memory.
@low-batt
Copy link
Contributor

The fix has been merged into the develop branch in commit 8682a54

@low-batt
Copy link
Contributor

Closing. Fixed in IINA 1.3.0.

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

No branches or pull requests

4 participants
0