I doubt it's practical to try something like this, unless you have a way to
make the entire memory space of a process shared.  A compiled stylesheet is
a complex object, and you'd need to make sure every piece of memory
allocated comes from a heap that allocates from the shared memory segment.

You might experiment with replacing global operator new(), but that would
be difficult, and code changes about how Xalan allocates things could break
all of your work.  Probably the best you can do is share the compiled
stylesheets among the threads within the same process.

Dave



                                                                                
                                                                  
                      <Ext-Mika.Stewen                                          
                                                                  
                      @nokia.com>              To:      
<[email protected]>                                                  
          
                                               cc:      (bcc: David N 
Bertoni/Cambridge/IBM)                                                      
                      03/26/2002 01:38         Subject: Sharing 
XalanCompiledStylesheets among processes?                                       
  
                      AM                                                        
                                                                  
                                                                                
                                                                  
                                                                                
                                                                  



Hi

I have a Bea Tuxedo based server running on HPUX 11.00 that provides
transformation services.
Other developers write the XSL files, and add the transformations to the
server's configuration. For efficiency the stylesheets are precompiled each
time the transformation server is started.

As the number of transformation services keep getting higher, so does the
run time memory image of the server application. Currently it is 250 MB.
And we need to have several instances of the server to provide load
balancing, at least two and preferably four. So that makes 500 MB or 1 GB
just for this one server.

To minimize this memory usage per server instance we would need to share
the precompiled stylesheets among the server instances. The first server
that starts, would compile the stylesheets to a shared memory segment, and
the other instances would attach to this shared memory segments and use the
precompiled stylesheets.

Sharing simple data in shared memory segments is simple, but how about
sharing XalanCompiledStylesheets? Could it be done? Can a
XalanCompiledStylesheet be created or copied to a shared memory segment?
Could it be serialized some how and share that way?

Any comments are welcome...

Regards,
Mika Stewen





Reply via email to