Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Memory Issues #24

Merged
merged 2 commits into from
Jan 15, 2025
Merged

Fix Memory Issues #24

merged 2 commits into from
Jan 15, 2025

Conversation

asleepace
Copy link
Owner

General

This pull request fixes several memory issues which were causing bun run build to fail with an OOM error code 137.

  • removed Rust ./backend/* directory
  • removed several caches on the server
  • updated documentation
  • added swapfile

SwapFile

This was the final fix which seemed to fix the problem, for whatever reason the default swapfile on the server was disabled. I was able to delete it and create a new one with:

# Remove old swapfile
sudo swapoff /swapfile
sudo rm /swapfile

# Create new one with proper permissions
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile
sudo mkswap /swapfile
sudo swapon /swapfile

# Verify it's working
free -h

Clear Caches

I also installed the Linux program ncdu which help track down several issues with old logs and caches which were taking up a lot of space.

# show log disk usage
journalctl --disk-usage

# Clear journal entries older than 7 days
sudo journalctl --vacuum-time=7d

# Or limit the size to 500M
sudo journalctl --vacuum-size=500M

# Edit config file to set limits
sudo nano /etc/systemd/journald.conf

# Set these:
# SystemMaxUse=500M
# SystemMaxFileSize=50M

@asleepace asleepace merged commit d708071 into main Jan 15, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant