I assume you are getting an OutOfMemoryError, perhaps because your -mx or -Xmx setting it too low.
Its not very clear what your data structure is or why you believe it shouldn't be 30 MB, however 30 MB is a fairly trivial amount of memory in a computer these days. A server with 8 GB costs about £850. Are you programming for a mobile device?
The best way to see how much a structure is using and why is to use a memory profiler. VisualVM is a profiler which comes with Java. YourKit is a commercial profiler which I find better.
It is quite likely you are not using the most memory efficient structure, but then again it quite likely it shouldn't make much difference.
Perhaps if you could clarify what you are doing when could suggest a better solution.
In Sun/Oracle's JVM you can point to a specific location in memory and allocate/free memory like in C, but it is highly unlikely to be a good idea. ;)