Actually, 'how big is an EJB instance?' is rather a more complicated
question than it would seem. Well, for starters, serializing it would
overestimate: the serialization format contains extra information
(typenames and such) that expand the stream, and the encoding itself
might inflate sizes.
<pedantic_mode>
Now as to why that question is more complicated than it seems, consider
that there are two possible interpretations of 'instance' - do you mean
a logical entity representing a set of data (for stateful session beans
or entity beans) or do you mean simply an instance of your bean, and the
related container structures? The difference becomes important when you
consider that the container might passivate the first 'instance' in
order to perform pooling of the second. In other words, you might have,
say, 10000 beans that are logically instatiated (they've been created),
but only 1000 instance of your bean classes in memory to serve them: the
container will activate and passivate them as needed in order to manage
your memory as a shared resource.
Another issue is that it depends on the server: jboss and IAS depend on
a lot of dynamic coding with metadata and introspection, whereas
something like WebSphere depends on a lot of code generation. This means
that the same set of beans will require less loaded classes in jboss
than in WebSphere (for example - most app servers do more code
generation than jboss).
</pedantic_mode>
Not that any of that will help with capacity planning.
danch
Xiaopong Tran wrote:
>
> Hi,
>
> We need to make a 'quite accurate' estimation of resource
> consumption by the system, and we'd like to know how to
> figure out the size of a particular instance of an EJB.
>
> Could someone suggest a hint on how to do that?
>
> I was thinking of serializing it to a byte array and
> count the number the bytes, but I'm not quite sure
> if that gives the right number.
>
> Thanks a lot.
>
> Xiaopong
>
> --
> --------------------------------------------------------------
> To subscribe: [EMAIL PROTECTED]
> To unsubscribe: [EMAIL PROTECTED]
> Problems?: [EMAIL PROTECTED]
--
--------------------------------------------------------------
To subscribe: [EMAIL PROTECTED]
To unsubscribe: [EMAIL PROTECTED]
Problems?: [EMAIL PROTECTED]