I just ran a little test on my code, and it doesn't seem like TreeSet could be the sole cause of your problems. I measured the memory usage for my code (around 16MB over the Java VM footprint of 3.5MB), then replaced the Vector I was using with a TreeSet and ran it again. The memory used went up from the previous 16MB to 20MB, not a huge jump, and well within the 64MB bound we seem to have been given.
Anyway, I can tell you my code is not specifically optimized for size (I use a few tricks here and there), so take it from me that it is possible to use a TreeSet and stay easily within the memory requirements. |