By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,032 Members | 825 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,032 IT Pros & Developers. It's quick & easy.

java.lang.OutOfMemoryError - Please Help-

P: n/a
Hi,

i wrote a java program, that create a rdf file parsing a file tree.
On the last step the shockwaves and gifs are checked and the byte
sizes are written in the rdf file as nodes.

The 1. Problem: A java.lang.OutOfMemoryError is throwm. Sometimes on
the 45 shockwave, sometimes on the 53 shockwave...
code:

for(int i = 0; i < objects.getLength(); i++){
String xValue = "concat(./dir/text(), ./objects/object/param[@name
=
'movie']/@value)";
// XPath Ausdruck anwenden
XObject xO = XPathAPI.eval(objects.item(i), xValue);
// the shockwave
f = new File(xO.toString());
// byte size
long size = f.length();
String x = "/*/Description[contains(@about, '" + f.getPath() +
"')]";
nodes = XPathAPI.selectNodeList(root, x.replace('\\', '/'));
if(nodes.getLength() == 1){
Node extent = target.createElement("dcterms:extent");
Node bytesize = target.createElement("lom-tech:ByteSize");
Node value = target.createElement("rdf:value");
Node length = target.createTextNode("" + size);
value.appendChild(length);
bytesize.appendChild(value);
extent.appendChild(bytesize);
nodes.item(0).appendChild(extent);
}
}

the 2. Problem.

After parsing the shockwaves i want to scall down images in the file
tree and save it. After this i want to add the new image url as node
to the rdf tree.

the same Exception!!!!

Thanks and greetings

novel
Jul 17 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
novel wrote:
Hi,

i wrote a java program, that create a rdf file parsing a file tree.
On the last step the shockwaves and gifs are checked and the byte
sizes are written in the rdf file as nodes.

The 1. Problem: A java.lang.OutOfMemoryError is throwm. Sometimes on
the 45 shockwave, sometimes on the 53 shockwave...


You have two options:

1) Use the -Xmx option to the java executable to increase the available
memory to the java process. (See the SDK tool documentation for details.)

2) Re-write your algorithms to use less memory.

Please, no side wagers on which one the OP will use :)

Ray

Jul 17 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.