Memory growth regression in NSMutableData


(Sai Kanduri) #1

Hi All,

I could see a memory leak when running a simple loop that creates NSMutableData objects and appends to them with swift-3.1-DEVELOPMENT-SNAPSHOT-2017-02-14-a-ubuntu16.10>I have not seen this leak with swift-3.0.2.

Following is the Leak Summary from Valgrind :

With Swift-3.0.2
==18606== LEAK SUMMARY:
==18606== definitely lost: 16 bytes in 1 blocks
==18606== indirectly lost: 20 bytes in 1 blocks
==18606== possibly lost: 0 bytes in 0 blocks
==18606== still reachable: 74,893 bytes in 10 blocks
==18606== suppressed: 0 bytes in 0 blocks
==18606== Rerun with --leak-check=full to see details of leaked memory

Swift 3.1

18411== LEAK SUMMARY:
==18411== definitely lost: 247,463,936 bytes in 59 blocks
==18411== indirectly lost: 0 bytes in 0 blocks
==18411== possibly lost: 171,966,640 bytes in 42 blocks
==18411== still reachable: 74,885 bytes in 10 blocks
==18411== suppressed: 0 bytes in 0 blocks

https://bugs.swift.org/browse/SR-3966 is the corresponding bug report.

Have anyone observed the same ?

-SaiHema