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-11917] Using JSONEncoder's .outputFormatting = .sortedKeys has a memory leak on Linux #3371

Closed
swift-ci opened this issue Dec 6, 2019 · 3 comments
Assignees

Comments

@swift-ci
Copy link
Contributor

swift-ci commented Dec 6, 2019

Previous ID SR-11917
Radar rdar://problem/57712097
Original Reporter xismic (JIRA User)
Type Bug
Status Resolved
Resolution Done
Environment

Linux (Ubuntu in a docker container - "ibmcom/swift-ubuntu-runtime:5.0.1")

Additional Detail from JIRA
Votes 0
Component/s Foundation
Labels Bug
Assignee @spevans
Priority Medium

md5: c2431dca125f7c1d873778023f27fb46

Issue Description:

On Linux only, When attempting to encode JSON using JSONEncoder, whilst setting its .outputFormatting property to .sortedKeys, a memory leak appears which.

When running many (e.g. 12) concurrent tasks quickly (every ~0.5s) can build up to a very large amount used memory (~4GB in a few minutes).

I'm assuming this is a bug in the Linux implementation of this feature (or a dependancy), as this doesn't occur when running on macOS from Xcode.

(Note this was discovered in a Swift on the server app (using Kitura) on Ubuntu in a docker container, both locally and on AWS)

@beccadax
Copy link
Contributor

beccadax commented Dec 6, 2019

@swift-ci create

@spevans
Copy link
Collaborator

spevans commented Feb 7, 2020

#2655

@spevans
Copy link
Collaborator

spevans commented Feb 13, 2020

Merged into master

@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

3 participants