As per the suggestion, I am doing the following in an
attempt to flush the cache after every 10,000 object
creation. Watching the "free memory", simultaneously,
I was expecting this free memory-count to jump up
every 10,000 objects - but, I am not seeing that. The
"free memory" count is,gradually, creeping downwards,
with occasional slight bump-ups. The application is
still running and will croak tonight if this fix is
not effective.
In the meantime, could somebody please confirm if I
have applied the fix correctly. "MyProduct" is the
ejb-ref-name in the application-client.xml
Thanks
Context context = new InitialContext();
Object o = context.lookup("java:comp/Administrator");
ApplicationAdministrator admin
= (ApplicationAdministrator)
PortableRemoteObject.narrow(o,ApplicationAdministrator.class);
.
.
.
while (true)
{
// Create a new Product and narrow the reference.
Product product = (Product)PortableRemoteObject.
narrow(home.create(i), Product.class);
name = "product"+i;
cost = i;
product.setName(name);
product.setPrice(cost);
if ((i%10000)==0)
{
admin.flushEJBCache("MyProduct");
System.out.println(name +" added. Took "
+((System.currentTimeMillis()-startTime)/1000+"secs"));
}
i++;
}
--- Globetrot Communications <[EMAIL PROTECTED]>
wrote:
> Could it be that Orion does not passivate entity
> beans, thus running out of virtual memory? I was
> able
> to restart the ProductClient and continue adding to
> the table.
>
> Does anybody know of a solution better than having
> to
> stop and restart?
>
> Thanks
>
>
>
>
> --- Globetrot Communications
> <[EMAIL PROTECTED]>
> wrote:
> > I am populating a postgreSQL database with
> "Product"
> > entity beans. I get a java.lang.OutOfMemeoryError
> > After adding about 200K entries. Am I getting this
> > error because all these entity beans stay in
> memory?
> > Is there a work-around it besides increasing the
> -mx
> > option value? How can one to create number of
> > objects
> > limited only by the disk-space?
> >
> > Thanks for your help.
> >
> > while (true)
> > {
> > // Create a new Product and narrow the
> > reference.
> > Product product =
> >
> (Product)PortableRemoteObject.narrow(home.create(i),
> > Product.class);
> > name = "product"+i
> > cost = i;
> > product.setName(name);
> > product.setPrice(cost);
> >
> >
> > }
> >
> > Satish
> >
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Auctions - Buy the things you want at great
> > prices.
> > http://auctions.yahoo.com/
> >
>
>
> =====
>
______________________________________________________
> 5.5 cents calls with 6-second billing no fees. Free
> toll-fre numbers. No other charges
> 4 cents Domestic calls with no fees:
> 5 cents per minute International calls also
> available
> http://globetrot.hypermart.net
> e-mail: [EMAIL PROTECTED]
>
______________________________________________________
>
> __________________________________________________
> Do You Yahoo!?
> Yahoo! Auctions - Buy the things you want at great
> prices.
> http://auctions.yahoo.com/
>
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - Buy the things you want at great prices.
http://auctions.yahoo.com/