Good point. Using "==" with String is wrong, bigtime, and will cause the
same symptoms as having no equals() method at all. I once wasted many hours
on precisely that flaw.


----- Original Message -----
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, January 23, 2001 9:08 AM
Subject: Re: Memory Leak


In conjunction with this point it is essential to say that some tools
produce buggy beans, e. g. EJBWizard for JOnAS
(mentioned on the JOnAS site): This tool writes code that implements the
equals method by simple comparison with the ==
operator, even if the used fields are Strings. This leads to the problem
that a bean that is made with EJBWizard, will be
loaded and loaded every time, because not every JVM keeps only one instance
of a string, because of efficiency/performance.
To work correctly, the beans have to be changed to use the String's equals
operator. I hope that this is only a bug of THIS
tool...


> Based on my experience with EJB and JOnAS, I believe your problem is most
> likely that you didn't implement all the methods you need to in your PK
> class. In addition to the constructors, you also need to implement
> hashcode() and equals(). Without those methods, JOnAS has no way to
> determine if an entity has already been loaded into RAM, so it keeps
loading
> it over and over and you eventually run out of memory. See the jonas docs
> and examples on how to fill out those two PK methods. Let me know how it
> turns out.
>
> Bryan
>
>
> ----- Original Message -----
> From: "G.C. Miller" <[EMAIL PROTECTED]>
> To: <[EMAIL PROTECTED]>
> Sent: Tuesday, January 23, 2001 1:21 AM
> Subject: Memory Leak
>
>
> > I have attached a simple ejb example when run for a few hours on my
> > machine it will run out of memory.  The bean is so simple it cant be in
> > its own code.
> >
> > I have tried this on a redhat 7.0 machine with all the updates.
> > I have also tried jdk 1.2.2 and 1.3.0.
> > I have tried native thread, green thread, and with jit, and no jit.
> > Same result always runs out of memory.  If I am doing something wrong or
> > if there is a magic combo to run could someone please share that with
me?
> >
> >
> >
>
> ----
> To unsubscribe, send email to [EMAIL PROTECTED] and
> include in the body of the message "unsubscribe jonas-users".
> For general help, send email to [EMAIL PROTECTED] and
> include in the body of the message "help".
>
> To: [EMAIL PROTECTED]
>     [EMAIL PROTECTED]


----
To unsubscribe, send email to [EMAIL PROTECTED] and
include in the body of the message "unsubscribe jonas-users".
For general help, send email to [EMAIL PROTECTED] and
include in the body of the message "help".

Reply via email to