I have an entity object composed of an id, large data in the form of a string and the hashcode of the string as an index. The attached test saves 2000 of these objects, writing the data to a txt file as it goes. It then loops through the data from the file and queries for the entity id based on the data hashcode and the data itself.
I'm running the test with -Xmx512m - I believe this should be sufficient as I only create/read one item of data at a time and am only querying for the id. After about 300 queries the test throws an out of memory exception so I assume the query data is being held internally. I've tried reducing the query-cache programs setting but this made no difference (I'm not 100% sure if it should anyway...). If you could assist it'd be much appreciated!
The aim behind the test is to create a data cache to prevent the need for large data to be held in memory. The data itself forms part of the query as there are duplicate data entries which I only want to store once in the cache.