Last year I needed to store strings in a Java Map using a limited memory.

The solution was rather simple: using a Lucene index to store the content on disk. This would provide interesting access performances. Here is the Gist: