Unludo is right that you need to use STAX to keep this process as efficient as possible - there are actually 5 different ways you can parse XML in Java, I outlined them all here along with pros/cons.
Anything that holds the entire content in ram (DOM or XPath) is going to be too memory intensive. SAX is much better, but it still parses out elements as it hits them and hands them off to your handler implementation while STAX won't parse anything out of the stream until you ask for it; it will only emit events to you to let you know what it is looking at.
That being said, I created the SJXP parsing library built ontop of STAX to provide STAX performance with XPath-ease-of-use.
You literally define paths in the file you are interested in, like:
/message/data -- represents the <message><data>[STUFF HERE]</data></message> path
And then give all the paths (they are basically rules) to the parser then give it the file you want to parse and it does all the dirty work for you, only calling your code when it finds exactly what you asked it for.
The implementation is hyper-efficient (I am not kidding, I spent days profiling it to get the overhead of the implementation BELOW the base STAX classes so it adds no measurable overhead) and super-easy to use.
NOTE You said that your byte[] that come with each message are "separate files", I am not sure what you mean here in the context of XML Parsing; I think a few of us probably assumed your binary data was base64 encoded inside of your XML messages, if that isn't the case and you have auxiliary payloads of data with each message coming over the wire, what you'll want to do to keep memory usage low is to stream that data (a chunk at a time) off the wire directly to your database.
If your database doesn't allow streaming to insert values a segment at a time and needs the entire byte[] blob, then just get that byte[] off the wire and into the DB as soon as possible to keep memory usage low; if those are really 1MB of raw data each then that is likely what is blowing your heap especially if there are a lot of simultaneous connections.
If you want to share more data about your impl I am sure we can help with suggestions.