Xcode indexing will cause my Mac Mini (M1) to crash when indexing is active (ON). ===> Xcode Version 12.5.1 (12E507)
To test the following, I created a smaller OSX desktop application, compared to my main OSX desktop application, which is significantly larger in scope, and size.
That said, I enter the following code in the terminal to activate and deactivate Xcode Indexing:
1. Indexing is active (ON) when applied in the terminal : defaults write com.apple.dt.XCode IDEIndexDisable 0
2. Indexing is NOT active (OFF) when applied in the terminal : defaults write com.apple.dt.XCode IDEIndexDisable 1
The application causing the crash with Xcode Indexing turned (ON), creates a PList file for my main application to use, which is an array of dictionary tuples. This application for the moment, creates a baseline array of 4,000+ dictionary objects with eight (8) tuple objects per dictionary. I use the same design with different, and significantly less information to create other PList array of dictionary objects, such as creating a PList array of dictionary objects for one column of objects instead of my application’s eight tableView columns. The smaller PLlist array of dictionary objects for an identified tableView column contains numeric information, which my application analyses to provide statistical data, such as mean, median, mode, maximum, minimum, number of occurrences, histograms, charts, et al. The smaller PList column application does not crash when Xcode Indexing is active (ON).
When Xcode Indexing is active (ON) for the larger PList application the following occurs:
1. Xcode quickly usurps all the RAM in my Mac Mini (M1 - 16 GB).
2. Activity Monitor shows “SourceKitService” climbs steadily to (20 GB) from (140 MB).
3. Activity Monitor shows “swift-frontend” climbs steadily to (80 GB) from (1 GB).
4. Activity Monitor shows “Physical Memory: 16 GB”
5. Activity Monitor shows “Memory Used: 14.01 GB”
6. Activity Monitor shows “Cached Files: 1.91 GB”
7. Activity Monitor shows “Swap Used: 29.49 GB”
8. Activity Monitor shows “App Memory: 3.69 GB”
9. Activity Monitor shows “Wired Memory: 1,012.5 MB”
10. Activity Monitor shows “Compressed: 8.53 GB”
11. Activity Monitor shows “Memory Pressure: Max”
My Mac Mini (M1) does not hesitate to show the Force Quit Modal: “Your system has run out of application memory.” Xcode ===> (“Xcode set at 309.0 MB”) Finder ===> (“Finder set at 158.2 MB”)
Boom, I must restart my computer.
When Xcode Indexing is NOT active (OFF) the following occurs:
1. The Mac Mini (M1) does not crash.
2. My application will NOT allow me to connect to any viewController outlet in my application from any IB.
3. Attempting a connection from IB to the associated properly named “viewController” presents the following error message:
===> Could not insert new action connection: could not find any information for the class named “blah blah blah …” <===
This exercise to turn “ON” and turn “OFF” Xcode indexing for my situation is repeatable. Turning (OFF) Xcode indexing introduces the above "Could not" error message, and turning (ON) Xcode indexing prevents the error message from showing with my smaller indexed applications.
So, for the moment, I can manually create an outlet in the “viewController” with copy and paste, “change” the new outlet name and function, then “connect” the IB item to the new viewController outlet, using “control-drag.” This “get-by-product” effort allows me to continue making connections without frustration.
For me, and my Mac Xcode programming experience, when Xcode Indexing is “OFF,” all the other internet suggestions to fix the “Could not insert new action connection” failed miserably. Those suggestions obviously worked for the individual poster, but unfortunately not for me.
When Xcode crashes with this error, my computer asks to send the issue to Apple, so I say “Yes.”
This experience blindly took me more than two months to isolate my application issue, through trial and error, trying to follow the numerous suggestions on the internet to no avail. I turned OFF Xcode Indexing a few months ago to prevent the larger indexing application from crashing. My efforts to resolve the “Could not insert new action” message included:
1. Creating new view controllers.
2. Copying the original viewController code into the new viewController.
3. Clean and rebuild.
4. Delete derived folders.
5. Reviewing possible “Automatic and Manual” assistant editor issues.
5. Believing my suspect object copy methods from one IB to another IB, caused the issue, therefore causing me to rebuild an IB or two from scratch.
The Xcode Index crashing issue, and the subsequent “Could not insert new action” issue happens to be annoying, but I am able to continue programming my application without Xcode indexing.
My main concern and my current dilemma right now happens to be, what will become of my application, since I cannot index the application without Xcode indexing causing my Mac Mini (M1) to crash … ?
Just curious … :]
All suggestions, as always, are welcome.
Best regards,
jim_k