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-4668] NSStringRef is probably leaking memory #47245

Closed
palimondo mannequin opened this issue Apr 22, 2017 · 3 comments
Closed

[SR-4668] NSStringRef is probably leaking memory #47245

palimondo mannequin opened this issue Apr 22, 2017 · 3 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself memory leak bug: Memory leak standard library Area: Standard library umbrella

Comments

@palimondo
Copy link
Mannequin

palimondo mannequin commented Apr 22, 2017

Previous ID SR-4668
Radar rdar://problem/31788787
Original Reporter @palimondo
Type Bug
Status Closed
Resolution Done
Environment

swift[master] at the time of this report

Additional Detail from JIRA
Votes 0
Component/s Compiler, Standard Library
Labels Bug, Leak
Assignee None
Priority Medium

md5: 4342c5e2d8af0036a7e3275ec4c25f03

relates to:

  • SR-4666 Dictionary bridge is leaking memory

Issue Description:

Running ObjectiveCBridgeStubFromNSStringRef performance test from Swift Benchmark Suite reveals suspicious memory usage in NSStringRef:

$ /usr/bin/time -lp $BUILD/bin/Benchmark_O --num-samples=1 ObjectiveCBridgeStubFromNSStringRef
[...]
  13815808  maximum resident set size

The maximum resident set size (MAX_RSS) slightly raises when we increase numSamples.

num-samples MAX_RSS (B)
1 13 815 808
3 14 831 616
10 14 958 592
20 15 101 952
100 15 224 832

The memory use is also slightly unstable between different runs:

num-samples MAX_RSS (B)
3 14 831 616
3 14 970 880
3 14 770 176

Same problem manifests when running benchmarks for ObjectiveCBridgeStubToNSStringRef.

@belkadan
Copy link
Contributor

@swift-ci create

@aschwaighofer
Copy link
Member

#9031

@palimondo
Copy link
Mannequin Author

palimondo mannequin commented Apr 26, 2017

I’ve verified that the tightening of the autoreleasepool made the test more stable between runs as well as not change when raising the num-samples.

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself memory leak bug: Memory leak standard library Area: Standard library umbrella
Projects
None yet
Development

No branches or pull requests

2 participants