<= vs <. Use the safer version.
Make the cache of ip2country data a SoftReference, not a WeakReference. WeakReference's are cleared every time there is a GC; SoftReference's are cleared only when there is memory pressure.