这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@edigaryev
Copy link
Collaborator

This makes Tart use mmap(2)-backed Data and InputFilter(.compress, ...) logic from Apple's documentation, which fixes the memory leak and results in smooth memory usage overall:

(this shows a lifetime of a Tart instance that pushed a 120 GB disk to the registry)

Resolves #165.

@edigaryev edigaryev requested a review from fkorotkov August 17, 2022 16:08
diskReadBytes += UInt64(data?.count ?? 0)
let mappedDisk = try Data(contentsOf: diskURL, options: [.alwaysMapped])
let mappedDiskSize = mappedDisk.count
var mappedDiskOffset = 0
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe name it mappedDiskReadOffset?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 06dc982.

mappedDiskOffset += bytesRead

progress.completedUnitCount += Int64(data?.count ?? 0)
progress.completedUnitCount += Int64(bytesRead)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe just set it to mappedDiskOffset?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See 9fdc597.

@edigaryev edigaryev requested a review from fkorotkov August 17, 2022 16:57
@edigaryev edigaryev enabled auto-merge (squash) August 17, 2022 16:57
@edigaryev edigaryev merged commit fea916d into main Aug 17, 2022
@edigaryev edigaryev deleted the fix-inputfilter-memory-leak branch August 17, 2022 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tart push gets terminated on a large image

3 participants