Xcode Application Continuous (OSX) Indexing Crash Problem

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

An update to this issue ... :]

The indexing issue within my PList creation application still exists when my file is very large, where the total dictionaries exceed the ability of the application to process them properly into a single PList file. The application's compilation causes the Mac Mini M1 (16GB) to usurp all the RAM, causing the Mac Mini to crash, especially when another application, such as Safari is active, Xcode is obviously active, and with the OS operating requirements too. I cannot acknowledge the "Force Quit" modal window to deactivate any application. The Mac is completely unresponsive. Therefore I must force the Mac Mini to restart by holding the power button for a few seconds. The issue existed with Xcode 12.5.1, Xcode 13.4.1, and still exists within Xcode 14.1.

The application presents a warning message with a large file after a minute or two, while indexing, which states "An internal error occurred. Source editor functionality is limited. Attempting to restore."

The warning message does not appear when the total dictionaries in the PList are few, and the Mac Mini does not crash. This total is difficult to determine what the actual passing grade total might be without empirical testing, but for the moment it happens to be less than one half of the current total dictionaries the application tries to submit into the PList. My current PList array of dictionaries total happens to be 8060 records.

Still curious as to whether Xcode is limited to the available RAM on my Mac Mini, while processing a file, or could my application be generating a memory leak ... ?

Best regards,

jim_k

Another update to this issue ... :]

I transferred the PList file application, which creates an initial PList file for my application, to another Mac with 48Gb of RAM, and the file indexed properly without issue. So, I confirmed my Mac Mini with 16Gb of RAM cannot index my file nor build the required PList file. Unfortunately, I must look for another Mac with more RAM to be able to proceed in the future. Not what I wanted, but what I must do ... :]

I guess I shall consider this issue as closed ...

Best regards,

jim_k

Xcode Application Continuous (OSX) Indexing Crash Problem
 
 
Q