OutOfMemoryException
Hello,
I have an external JAR and I must call his main. This JAR has to encrypt a file.
But if the file is too big, the main returns an OutOfMemoryException.
I know the "-Xms256m" and "-Xmx512m" but if I call the main like this :
PrepareImportFile pif = new PrepareImportFile();
String[] args = {fileSource, fileCrypt, "-f", "keyp.txt", "-Xms256m", "-Xmx512m"); pif.main(args);
it doesn't work.
It is normal because -Xms256m -Xmx512m are applied to the JVM.
But I don't find a solution.
Is it possible to grow up the memory allocated to the JVM into the java code ?
I thank you for your help.
[661 byte] By [
kryptona] at [2007-11-27 2:10:55]

Thanks for your answer.
I can't use sources of this jar. This is a bought component and I have not to decompile it.
How coud you proceed using a new thread ? I thought threads were only used for "light" tasks. And how this solution can help me ?
"you could also call these parameters on your jvm."
Is this possible to dinamically modify these parameters ? My application will be deploy and I can't tell to all user to modify these parameters.
Thanks for your help.
> Yes. Just 1 Mo caused the OutOfMermoryException...
> but I can't decide and I must use it.
Says who! Presumably some idiot manager. If so then tell him what he can do with his pp code. You have to learn to put managers in their place. They should not be involved in technical decisions unless they have have the expertise and most don't. Ask your manager why the rubbish encryption code has to be used.
That's not very important because he's not in the in the firm yet.
I deduct this is not possible directly. I wanted to change memory parameters into the code.
If I use the thread solution, is this possible to put a parameter somewhere in the JAR file in order to double click only on the JAR file ?
I don't want to create a bat with a command line.
Thanks.