Skip to content
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

[SR-6962] NSMutableData leak on Linux with Swift 4.1 #4258

Closed
swift-ci opened this issue Feb 9, 2018 · 1 comment
Closed

[SR-6962] NSMutableData leak on Linux with Swift 4.1 #4258

swift-ci opened this issue Feb 9, 2018 · 1 comment

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Feb 9, 2018

Previous ID SR-6962
Radar None
Original Reporter djones6 (JIRA User)
Type Bug
Status Closed
Resolution Done
Environment

Ubuntu 14.04, Swift 4.1-DEVELOPMENT-SNAPSHOT-2018-02-01-a

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug, Leak
Assignee mamabusi (JIRA)
Priority Medium

md5: 9965209baa675bd606956e1c2c7be64c

Issue Description:

When rrunning Kitura on recent 4.1 and master snapshots, I observe a memory leak on calls to NSMutableData.append().

I would guess that this is related to the same set of changes as SR-6849, but I have not attempted to prove that. Extract from a valgrind massif report:

93.39% (7,852,969B) (heap allocation functions) malloc/new/new[], --alloc-fns, etc.
->69.76% (5,866,048B) 0x552B7FF: __CFSafelyReallocate (CFBase.c:771)
| ->69.76% (5,866,048B) 0x55589FA: __CFDataGrow (CFData.c:554)
|   ->69.76% (5,866,048B) 0x5556F41: CFDataReplaceBytes (CFData.c:639)
|     ->69.76% (5,866,048B) 0x5558C1D: CFDataAppendBytes (CFData.c:609)
|       ->69.76% (5,866,048B) 0x580576B: Foundation.NSMutableData.append(Swift.UnsafeRawPointer, length: Swift.Int) -> () (NSData.swift:1059)
|         ->69.56% (5,849,088B) 0x241742: KituraNet.HTTPServerResponse.(writeToSocketThroughBuffer in _8A9E8F62631F03CCFCED4F4223E40C30)(text: Swift.String) throws -> () (HTTPServerResponse.swift:204)
...etc

KituraNet code here is: https://github.com/IBM-Swift/Kitura-net/blob/2.0.1/Sources/KituraNet/HTTP/HTTPServerResponse.swift#L204

@swift-ci
Copy link
Contributor Author

Comment by David Jones (JIRA)

This was resolved by mamabusi (JIRA User) in:

#1455

(and #1458 for the 4.1 branch)

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
@shahmishal shahmishal transferred this issue from apple/swift May 5, 2022
This issue was closed.
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

1 participant