Hi Jan,
For example for a xml-file with the size of 79167874 ("FACTOR", as shown by the web-gui) "session.execute(new XQuery("doc('db/file.xml')"));" will result in an exception[0].
First of all, we have recently improved logging output for the client/server architecture with BaseX 8.6.1. Maybe you get some more helpful output with the latest snapshot [1]?
To decrease memory consumption, you can specify an output stream in your client (via setOutputStream). Do you really want to return the full XML document and process it in main memory? Returning 80 MB of data should not cause serious problems, though, even with 1GB of RAM. Did you manage to successfully parse this resource in the BaseX GUI (or is the document already stored in a database)?
My assumption is that a timeout is exceeded somewhere.. so my next question is how to properly set the timeout
For non-admin users, you can set a global server timeout via the TIMEOUT option [2]. If I remember correctly, the timeout will not be checked while a resource is parsed, it could be that it does not necessarily stop your query in time.
Cheers, Christian
[1] http://files.basex.org/releases/latest/ [2] http://docs.basex.org/wiki/Options#TIMEOUT