Memory leak

while(data.next()){Order orderObj = new Order();..........orderList.add(orderObj);}In one of the method I have the above code. I see that there is a memory leak at lineOrder orderObj = new Order();how can this be fixed? Thanks.
[290 byte] By [Rxyza] at [2007-11-26 20:09:40]
# 1
> I see that there is a memory leak at lineHow can one see memory leaking?
DrLaszloJamfa at 2007-7-9 23:12:49 > top of Java-index,Java Essentials,New To Java...
# 2
What? Provide some context! Tell us what you're doing and why you think that line is a "memory leak" because that line in and of itself isn't enough.
kablaira at 2007-7-9 23:12:49 > top of Java-index,Java Essentials,New To Java...
# 3
How many Order objects are you creating?
floundera at 2007-7-9 23:12:49 > top of Java-index,Java Essentials,New To Java...
# 4
I am using a tool that is showing memory leak at this line. right now creating about 200 obj's. any suggessions?
Rxyza at 2007-7-9 23:12:50 > top of Java-index,Java Essentials,New To Java...
# 5
Is the constructor calling native code?
DrLaszloJamfa at 2007-7-9 23:12:50 > top of Java-index,Java Essentials,New To Java...
# 6
the orderObj is just a bean with get, set methods in it.
Rxyza at 2007-7-9 23:12:50 > top of Java-index,Java Essentials,New To Java...
# 7
> the orderObj is just a bean with get, set methods in it.So how could that leak?
DrLaszloJamfa at 2007-7-9 23:12:50 > top of Java-index,Java Essentials,New To Java...
# 8
I don't understand it either.
Rxyza at 2007-7-9 23:12:50 > top of Java-index,Java Essentials,New To Java...
# 9
So you create an object and you add it to a list. And you do this in a loop. And you created about 200 objects.None of that seems abnormal to me at all. My guess is that you got this tool and you don't know how to use it.
DrClapa at 2007-7-9 23:12:50 > top of Java-index,Java Essentials,New To Java...
# 10
> I don't understand it either.That much is obvious. However, without any context other than "a tool says this is the problem" how can we possibly help?
kablaira at 2007-7-9 23:12:50 > top of Java-index,Java Essentials,New To Java...