Frequent Freezes in Cursor AI IDE - Any Solutions?

@ajmeese7 I had the same issue, tracked it down to state.vscdb freezing my whole PC when being updated. My process monitor was showing massive writes to that sqlite3 database, even when it was only couple of MB with size it was still crippling a 16core 7950x with 128GB RAM… What I did was moved it to tmp and made an autostart script that copies the database file to /tmp which is stored in RAM memory and periodically does a backup where the original file is stored. I don’t encounter any freezes at all now.

Below is the script made with Cursor haha

#!/bin/bash

Source and destination paths

BACKUP_DIR=“$HOME/.config/Cursor/User/globalStorage”
SOURCE_FILE=“${BACKUP_DIR}state.vscdb”
TEMP_DIR=“/tmp/cursor_state”
TEMP_FILE=“$TEMP_DIR/state.vscdb”
BACKUP_FILE=“$BACKUP_DIR/state.vscdb_backup”

Function to create backup

create_backup() {
# Create backup directory if it doesn’t exist
mkdir -p “$BACKUP_DIR”

# Create backup with timestamp
backup_file="$BACKUP_DIR/state.vscdb_backup"

# Copy the temp file to backup location
cp "$TEMP_FILE" "$backup_file"
echo "Backup created: $backup_file"

}

Create temp directory if it doesn’t exist

mkdir -p “$TEMP_DIR”

Check if backup exists and use it, otherwise use original file

if [ -f “$BACKUP_FILE” ]; then
echo “Using existing backup file”
cp “$BACKUP_FILE” “$TEMP_FILE”
else
# Check if source file exists
if [ ! -f “$SOURCE_FILE” ]; then
echo “Error: Neither backup nor source file exists”
exit 1
fi
echo “Using original source file”
cp “$SOURCE_FILE” “$TEMP_FILE”
fi

Remove existing symlink if it exists

if [ -L “$SOURCE_FILE” ]; then
rm “$SOURCE_FILE”
fi

Create symlink

ln -s “$TEMP_FILE” “$SOURCE_FILE”

echo “Cursor state file has been moved to $TEMP_FILE and symlinked”

Start backup loop in background

while true; do
create_backup
sleep 600 # Sleep for 10 minutes
done &

2 Likes