The ObjectStore cache

ObjectStore automatically caches the results of any selects it runs. This reduces SQL calls in surprising ways, in particular by calculating if queries are subsets of previous queries. The cache is only updated on updates, inserts, and deletes.

If you are running a long-running program that does a lot of selects, without updates, inserts, and deletes--for example, a big reporting program--you'll find that the program will use a lot of memory, as it slowly begins to clone the database in RAM. You can trim the cache by calling ObjectStore#flush.

object_store.flush( user )