This must be normal. Try changing DomainConfiguration.QueryCacheSize to 1 and run one more query after this one (or run > 1024 other queries after the first one) - I suspect the reference must disappear.
DO4 caches compiled RSE queries using LruCache (it's shown in graph), but this cache truly works only when you use either the same RSE query object for multiple times )we use this technique internally), or use our own compiled queries (they're compiled just once, so there is just one RSE query as well). All the other queries simply pass through this cache (may be we'll improve this further).
P.S. I don't remember exact LruCache cleanup policy - i.e. possibly it might keep the references to some objects that must be already thrown out a bit longer then it is really necessary - I know we use this approach with other caches to ensure amorthized (= for a large set of operations) insertion and access time is O(1) there.
So may be you must run more queries to get the first one uncached.
Sorry for disinformation: DomainConfiguration.QueryCacheSize affects on size of compiled queries cache only (i.e. cache used by Query.ExecuteXxx); RSE query cache size is defined as static fields, its value is 1024, so currently you can't change it.
answered
Apr 27 '10 at 11:53
Alex Yakunin
2971●4●4●12