Memory Issues

My app is a Smart Client App using a few Tamino mobile db’s. I use the sync adapter to initialise my XML db, which is 3mb big.

The problem is that I’m having a problem with memory, the application uses so much that it kills the EVM console. Every time I do an xpath search, my memory usage increases by 300kb. Just doing the initial sync takes up about 20mb (bit much for a 3mb file).

What could be the cause for the memory usage?