Mac Spinning Beachball in IDE

Recently (~ since Xojo 2025 3.1), I have been occasionally seeing the spinning beachball that can last ~ 20 to 60 seconds. This might occur every couple of hours during a coding session. I change something in the code or move a control in a window, and suddenly the spinning beachball appears. I worry that there has been a crash, but ultimately it resolves.

In years past, this never occurred. Have others seen this? Is it Tahoe? Is it me? Is it recent versions of Xojo?

In my current session, it has occurred three times in less than 15 minutes of coding. I have saved the application. I have Built the application. Doesn’t seem to change things.

Recently I moved from using .xojo_binary_project as my project file format to .xojo_project, but this was occurring while I was still using .xojo_binary_project.

There’s an open ticket, but Xojo can’t reproduce an issue in-house.

#80879 - When in the IDE debugger the beachball very often displays making it impossible to interact with the debugger

1 Like

Thanks for the link to the feedback issue. Comforted that it is occurring to others. Sad that Xojo cannot confirm. I have not figured out any particular way to make it happen. The changes that I am making to my code are generally trivial; it is not as if I am pasting in many lines of code or something of that ilk.

Yeah, I’ve seen the same thing when selecting text in the editor. No idea what triggers it.

At the end of the day, it’s annoying having to wait 10-30 seconds, but I have yet to see a crash.

I’ve seen it as well, quite often. CMD+Tab corrects it for some reason…at least until the next time.

A fair question is whether the machine has adequate resources, as RAM hungry as Xojo is. I’ve not really seen this issue, but I could see a large project thrashing the swap file.

Yes, I also noticed this when selecting code.

The trick is to click outside the Xojo window (deactivate) and click back in the Xojo window (activate). Then it is ok again.

1 Like

With 24gb and a new small project it does also happen.

This is on an M2 Pro with 32 GB of RAM, so that shouldn’t be the issue.

1 Like

If you can catch it happening, grab a sample using Activity Monitor.app:

2 Likes

The problem is that switching the front most window from Xojo to anything else (either by CMD+Tab or clicking a different window) corrects the behavior. I tried this when I first saw the problem and it’s just not possible.

Good call. This looks like it’ll work via the Shortcuts app.
I suppose there’s a good chance that the keyboard shortcut won’t work while the frontmost app is unresponsive, but it’s worth a shot.

#!/bin/bash

APP_NAME="Xojo"
DURATION=5
OUTFILE="$HOME/Desktop/xojo_sample_$(date +%Y%m%d_%H%M%S).txt"

PID=$(ps aux | grep "/$APP_NAME.app/Contents/MacOS/$APP_NAME" | grep -v grep | awk '{print $2}' | head -n 1)

if [ -z "$PID" ]; then
  echo "Xojo main process not found"
  exit 1
fi

sample "$PID" "$DURATION" -file "$OUTFILE"

I just hope that I remember the shortcut when I need it…

1 Like

iCloud ?

I’m on a work laptop that has iCloud almost completely disabled aside from things like Notes and Shortcuts, so I don’t think it’s that.

Another way to do this in a one-liner shell command:

sleep 5 ; sample 12345 5 -file XojoSample.txt

  • replace 12345 with the PID of the Xojo app, which you can see in Activity Monitor
  • the first “sleep 5” gives you 5 seconds to switch back to the Xojo app and trigger the beachball.

If you have BBEdit and the command line tools installed:

sleep 5 ; sample 12345 5 | bbedit

will open the sample info in a new BBEdit window

Edit: an even simpler version, using the pgrep command which returns the PID for a named process:

sleep 5 ; sample `pgrep Xojo` 5 | bbedit

I managed to catch a sample when the beachball showed up while trying to expand a row in the source list. It appears to be recursive paint calls. Which would explain why deactivating the window “fixes” it, since the paint calls would stop.

xojo_sample_20260320_101641_sourcelist.txt.zip (35.4 KB)

And here is the ChatGPT analysis FWIW…

This sample isn’t “hung” in the traditional sense (deadlock or waiting on a lock). It’s actually spinning the UI thread in a pathological repaint/layout loop.

What the sample shows

Everything is happening on the main thread inside the event loop :

  • NSApplication run → nextEventMatchingMask → normal UI loop
  • But instead of idling, it’s constantly executing paint/layout code:
    • SourceList.SourceCanvas_Paint
    • SourceListSupport.SourceListRow.Event_Paint
    • Graphics.DrawString / DrawPicture

The real problem

Inside that paint cycle, there’s deep recursive layout computation:

  • VisibleHeight → CollapsedHeight → Prefs.NavigatorUseLargeFont
  • Then back into layout again
  • Repeated many times in the same stack

You can literally see self-recursion / repeated calls :

  • VisibleHeight calling VisibleHeight again
  • UpdateRowPositions being triggered during painting

Why it hangs

This creates a feedback loop:

  1. Paint event runs
  2. Paint triggers layout (UpdateRowPositions)
  3. Layout queries item sizes (VisibleHeight)
  4. Size calculation depends on preferences / dictionary lookups
  5. That re-enters layout/paint logic again
  6. Repeat… endlessly

So the app:

  • Never returns to the event loop
  • Burns CPU on the main thread
  • Appears frozen (beachball), but is actually busy

Key insight

This line is the smoking gun pattern:

Paint → UpdateRowPositions → VisibleHeight → VisibleHeight → …

That means:

  • You are mutating layout during paint
  • And/or your size calculation is not stable (re-entrant / recursive)

Typical causes in Xojo

This usually comes from one of these:

  • Calling Invalidate / Refresh inside Paint
  • Changing data/layout inside Paint
  • A computed property (like VisibleHeight) that:
    • depends on mutable state
    • triggers layout recalculation
  • Preference lookups or dictionary access that indirectly trigger UI updates

Bottom line

:backhand_index_pointing_right: The hang is caused by a runaway repaint + layout recursion loop on the main thread , not a deadlock.

1 Like

I’m currently working on a project where a dictionary has about 300 entries. It takes super long to show the values in the IDE. I’ll make a ticket later today.

I will add that I am seeing this on 3.1 with Mac M3Max 128gb Tahoe. See it on very small projects. i posted another discussion as I had not seen this one. But this definitely exists and it is very regular.