Just because there where several different (and some misleading) answers:

The problem described is solved with the newest orion version (i don't
rember, if since 1.4.5, .6 or .7, i am using .7). As Kevin described, you
must set the max-instances attribute for _each_ entity bean that is supposed
to have much instances.

Unfortunately, there is no overall server setting like "If the VM uses X MB
of memory, kick some least used entity beans out of the cache". Therefore
one has to play around with the settings to find a combination, that fits
the needs (note, that every time you add an entity bean type, the possible
maximum overall amount of memory increases, too, which sadly, sadly cannot
be said of the physical memory in your machine...).

BTW: code like creating 100.000 _entity_ beans in a loop is generally
supposed to work - entity beans must be only deleted, if you want to delete
their persistence (the database entry). Instead it would be no good coding
practice, to create tons of _session_ beans without deleting them after use.

Best regards,

Jens Stutte

> -----Ursprüngliche Nachricht-----
> Von: Kevin A. Palfreyman [mailto:[EMAIL PROTECTED]]
> Gesendet am: Dienstag, 27. März 2001 17:25
> An: Orion-Interest
> Cc: [EMAIL PROTECTED]
> Betreff: RE: java.lang.OutOfMemoryError
> 
> We found we could force passivation in the later orion 
> builds - not sure exactly whch builds it works in, but 
> its OK in 1.4.7.
> 
> Create a directory called orion in the root of your ejb jar 
> (i.e. as a sibling of your META-INF directory).
> 
> In the orion folder, create a file orion-ejb-jar.xml
> (The easy way is to copy the one that was auto created on a previous 
> deployment - look in the $ORION_ROOT\application-deployments and 
> the correct sub-folder.)
> 
> Edit the file so that there is a max-instances="100" attribute on 
> each of the entity-deployment entities.
> 
> Delete the previous deployment directory (otherwise 
> the new file will not be copied over), and repackage/deploy.
> 
> Seems to work for us.
> 
>       Kev
> 
> -----Original Message-----
> From: theo van niekerk [mailto:[EMAIL PROTECTED]]
> Sent: 27 March 2001 15:31
> To: Orion-Interest
> Subject: java.lang.OutOfMemoryError
> 
> 
> Hi there
> 
> Orion is a great application server for small web apps. (We have
> deployed 2
> small sites using orion with success).
> 
> But the moment you start thinking of using it for bigger more serious
> apps
> it will always throw a java.lang.OutOfMemoryError
> 
> The problem: Orion does not passivate EJB's.
> 
> Attached an EAR file that will show this.
> 
> How to deploy..
> 
> Change your server.xml file to include something like..
> 
>       <application name="orionTest"
> path="file://C:/work/oriontest.ear" />
> 
> Start orion the normal way..
> 
>       java -jar orion.jar
> 
> Well, I don't know how to execute an external client that reference
> classes
> inside a jar that is inside an ear, but the following works fine..
> 
> Unjar/Unzip the EAR
> Unjar/Unzip the JARS
> 
> (I've used the directory structures..
>       c:\work\oriontest
>       c:\work\oriontest\test-ejb
>       c:\work\oriontest\test-client
> 
>       and orion.jar is in..
> 
>       c:\PRG\orion)
> 
> execute..
>       c:\work\oriontest\test-client\test.cmd
> 
> or cd to..
>       c:\work\oriontest
> 
> and execute..
>       c:\java\jdk1.3\bin\java -cp
> .;test-client;test-ejb;c:\PRG\orion\orion.jar
> tests.TestClient 1 100000 2000
> 
> 
> PARAMS..
> index of first bean to create = 1
> create 100000 beans
> refresh home reference every 2000 creations (thought it could make a
> difference)
> 
> and after 6410 creations..
> 
> Created bean...6410
> Exception in thread "main" java.lang.OutOfMemoryError
>         at com.evermind.server.rmi.bb.invokeMethod(JAX)
>         at com.evermind.server.rmi.a2.invoke(JAX)
>         at com.evermind.server.rmi.a3.invoke(JAX)
>         at __Proxy0.create(Unknown Source)
>         at tests.TestClient.loopTest(TestClient.java:33)
>         at tests.TestClient.main(TestClient.java:39)
> 
> And about 7 seconds later on the server side..
>       a single bean gets passivated
> 
> Good Luck
> 
> 
> 
> 
> 
> 
> 

Reply via email to