The trick is to limit the number of elements to avoid running out of memory.
Depending on what your map contains, you might need to make it a cache that only stores N elements, and expires old ones as new ones come in. Another thing might be to reduce the size of what you are storing. If you are storing Lang.Double objects and can get away with it, switch to using a Lang.Float.