Did your test run long enough to take into account the garbage collection of
instantiated objects?  Remember in object pooling there is no GC overhead
for pooled objects as they never fall out of scope.

Dave Wolf
Internet Applications Division
Sybase

----- Original Message -----
From: "Arkady Kasianski" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, March 21, 2001 2:00 PM
Subject: Object Pooling


> Hi,  I am a little confused � What is the motivation to have an object
> pooling ? For stateless beans it does not give a much , since sateless
bean
> a light-weight one , for statefull it�s not so relevant, since state
should
> be cleaned before putting into the pool. Where is the prize ?� I did a
> simple test with a simple java class. See below. And the differnce was a
> minor only after arraySize > than 100 000     Could anyone shed some light
> in this ?
>
> public class CList
> {
> //  private String s = new String ();
>
>   public static void main(String[] args)
>   {
>     final int arraySize = 100000;
>
> // Allocation
>     long before = System.currentTimeMillis();
>     CList listArr[] = new CList [arraySize];
>
>     for (int i=1; i < arraySize; i++)
>     {
>         CList l = new CList();
>          listArr[i] = l;
>     }
>     System.out.println(System.currentTimeMillis() - before);
>
> // No allocation
>     before = System.currentTimeMillis();
>     for (int y=1; y < arraySize; y++)
>     {
>         CList ll = listArr[y];
>     }
>
>     System.out.println(System.currentTimeMillis() - before);
>
>    }
>
>
===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".
>
>

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to