out of memory warning

This morning I started getting an out of memory warning. Here is an example from the log:

10:40:09 AM   System.Data.SQLite.SQLiteException (0x80004005): out of memory
10:40:09 AM out of memory
10:40:09 AM    at System.Data.SQLite.SQLite3.Prepare(SQLiteConnection cnn, String strSql, SQLiteStatement previous, UInt32 timeoutMS, String& strRemain)
10:40:09 AM    at System.Data.SQLite.SQLiteCommand.BuildNextCommand()
10:40:09 AM    at System.Data.SQLite.SQLiteCommand.GetStatement(Int32 index)
10:40:09 AM    at System.Data.SQLite.SQLiteDataReader.NextResult()

Is there a way to fix this?

I got it running by archiving everything. Now I have been manually restoring the folders with archived
emails to the empty folders. crude but seems to be working. Now have to see if I get error msg Out of Memory again.