You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A memory leak in SourceKitService was introduced between snapshot 18.12.15 and 22.12.15.
Here are my findings:
Some git-bisecting led to the first introduction in commit:
["Clang importer: enable the Swift name lookup tables by default." | ae6b41d]
Further changes were made in commit:
["Clang importer: delete most of the old name lookup path. NFC" | 1989475]
There were no significant changes made to SourceKit between both snapshots, only typo fixes.
Profiling SourceKitService with Instruments (Leaks, VM Tracker) and observing the open files in Activity Monitor shows lots of duplicate open files.
Steps to reproduce
Select any Swift Snapshot since 22.12.15. Xcode version does not matter, SourceKitService is independent from Xcode.
Create a new Swift project (or use an existing one). Size of the project doesn't matter. The only part that influences how fast memory grows is the number of imported modules. The "Hello, World!" default file with Foundation imported should be enough.
Monitor memory usage of SourceKitService.
Change anything in the source file (holding space should be enough). After a few seconds SourceKitService uses about 1GB memory
Helpful debugging tips
I don't know enough about XPC services and Google didn't produce any helpful tips, so here is the best way I found to get more information about the leaks. Maybe these tips are helpful for others:
Attaching Instruments to SourceKitService is not really that helpful because it is not linked to CoreFoundation.
To get more detailed information about the leaks (stack traces) do the following:
Use the MallocStackLogging environment variable by adding this to the XPCService dictionary
in $SNAPSHOT/usr/lib/sourcekitd.framework/Versions/A/XPCServices/SourceKitService.xpc/Contents/Info.plist.
I attached the Info.plist I used.
Then you can use the command line tools malloc_history and leaks on the SourceKitService process.
The text was updated successfully, but these errors were encountered:
Attachment: Download
Environment
OSX 10.11.2
Xcode 7.2 and 7.3
Any Swift snapshot since 22.12.15
Additional Detail from JIRA
md5: 8fe65d0623d257e3bb29cb40c115af2c
Issue Description:
A memory leak in SourceKitService was introduced between snapshot 18.12.15 and 22.12.15.
Here are my findings:
Some git-bisecting led to the first introduction in commit:
["Clang importer: enable the Swift name lookup tables by default." | ae6b41d]
Further changes were made in commit:
["Clang importer: delete most of the old name lookup path. NFC" | 1989475]
There were no significant changes made to SourceKit between both snapshots, only typo fixes.
Profiling SourceKitService with Instruments (Leaks, VM Tracker) and observing the open files in Activity Monitor shows lots of duplicate open files.
Steps to reproduce
Select any Swift Snapshot since 22.12.15. Xcode version does not matter, SourceKitService is independent from Xcode.
Create a new Swift project (or use an existing one). Size of the project doesn't matter. The only part that influences how fast memory grows is the number of imported modules. The "Hello, World!" default file with Foundation imported should be enough.
Monitor memory usage of SourceKitService.
Change anything in the source file (holding space should be enough). After a few seconds SourceKitService uses about 1GB memory
Helpful debugging tips
I don't know enough about XPC services and Google didn't produce any helpful tips, so here is the best way I found to get more information about the leaks. Maybe these tips are helpful for others:
Attaching Instruments to SourceKitService is not really that helpful because it is not linked to CoreFoundation.
To get more detailed information about the leaks (stack traces) do the following:
Use the MallocStackLogging environment variable by adding this to the
XPCService
dictionaryin
$SNAPSHOT/usr/lib/sourcekitd.framework/Versions/A/XPCServices/SourceKitService.xpc/Contents/Info.plist
.I attached the
Info.plist
I used.Then you can use the command line tools
malloc_history
andleaks
on the SourceKitService process.The text was updated successfully, but these errors were encountered: