473,396 Members | 2,070 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

java.lang.OutOfMemoryError - Please Help-

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
1 3149
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: David Van D | last post by:
Hi there, A few weeks until I begin my journey towards a degree in Computer Science at Canterbury University in New Zealand, Anyway the course tutors are going to be teaching us JAVA wth bluej...
1
by: Marwa5 | last post by:
I’m a service desk 4.5 administrator & I have a lot of java errors on our servers & SD application so kindly check below errors & waiting your help: “Java.lang.OutOfMemoryError” & ...
1
by: sunilkumar.r80 | last post by:
Hi I have a problem in reading a .xls file using java. I am using jakarta POI ApI for that it work fine for a 9000 rows contians 25 colums. But i need to read more than 25000 rows (in a single...
14
by: mlw | last post by:
Do not take anything about this, it is not a flame or troll, while I'm not new to Java I favor C++. However, I may need to use it in a contract position, and am concerned that the restrictions it...
0
by: subashinicse | last post by:
hi everybody, am working with J2EE &hibernate... while i run my application,am sending an object(filetype of size more than 8MB) from jboss to securityserver,where am getting ERROR as...
0
by: subashinicse | last post by:
hi everybody, am working with J2EE &hibernate... while i run my application,am sending an object(filetype of size more than 8MB) from jboss to securityserver,where am getting ERROR as...
5
blazedaces
by: blazedaces | last post by:
Ok, so you know my problem, java is running out of memory reading with SAX, the event-based xml parser intended more-so than DOM for extremely large files. I'll try to explain what I've been doing...
1
by: KritiGuleria | last post by:
Hi i am getting an error java.lang.OutOfMemoryError while running a few java files. i have already increased JVM heap memory (Xmx=512 and Xms=512 from 256). but this didnot fix my problem. the RAM...
1
by: HxRLxY | last post by:
I have a program that shows a thumbnail of an image. If the user clicks on the thumbnail a new JFrame is opened that shows the full size image. If the image is larger than the screen, it gets...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.