[jboss-user] [Remoting] - Re: JBoss Remoting and compression

2009-08-05 Thread ron.si...@jboss.com
There's another chapter to the story.

I noticed recently that NewCompressingMarshallerTestCase, which runs in about 
half a minute on my Windows laptop, takes about 13 minutes on one of the Red 
Hat linux test machines. It turns out that the GZipOutputStream constructor 
takes an order of magnitude longer in linux than in Windows. I've changed 
CompressingMarshaller so that it reuses a single GZipOutputStream but replaces 
the Deflater with each call to write(). CompressingUnMarshaller has the 
symmetric changes with respect to Inflater. Now 
NewCompressingMarshallerTestCase takes about 18 seconds on my Fedora laptop.

I've attached to JBREM-1077 Fix problem in CompressingMarshaller a copy of 
jboss-remoting.jar from the 2.x branch with the changes.

View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=4248222#4248222

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4248222
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Remoting] - Re: JBoss Remoting and compression

2009-07-27 Thread ron.si...@jboss.com
I've applied Doychin's fix to branch 2.2 (for release 2.2.3.SP1) and branch 2.x 
(for release 2.5.2).

Previews of jboss-remoting.jar from each of these branches are attached to 
JBREM-1077 if anyone one wants to test the new versions.

I've tested the changes with a sample EJB3 that copies strings to the server 
and back.  It is also attached to JBREM-1077.

View the original post : 
http://www.jboss.org/index.html?module=bbop=viewtopicp=4246317#4246317

Reply to the post : 
http://www.jboss.org/index.html?module=bbop=postingmode=replyp=4246317
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Remoting] - Re: JBoss Remoting and compression

2009-01-03 Thread doychin
In order to allow compression to work with EJB 2.x invocations I created my own 
Compression marshaller and unmarshaller which descend from original classes. 

The default constructor for both classes now call the constructor that takes 
one parameter of type Marshaller/UnMarshaller with new 
InvocationMarshaller()/InvocationUnMarshaller().

I also did new versions of read/write methods which I use to test different 
variants for calling GZip streams.

From my experiments I can tell that switching 

 oos.flush(); and gzos.finish();

does not help. 

I'm still getting exceptions for incorrect version in the stream. But I also 
found a solution which is in the code below.

In order to workaround the other problem with OutOfMemory exception I created 
new GZip input/output stream classes that descend from the original Java 
classes.

in my Output stream I added new finish method

 public void finish() throws IOException
  | {
  | super.finish();
  | def.end(); // This will release all resources used by zlib 
  | }
  | }

in the input stream I added new method

 public void end() throws IOException
  | {
  | while (available()  0) { // This tell the gzip input stream to 
read the extra trailer put by finish method in output stream. This all removes 
the need to use buffered stream like in 2.x branch
  | read();
  | }
  | inf.end();
  | }
  | 

and I call this new method at the end of read method.

this way I can use original java GZip classes without having to relay on 
external libraries.

- inf and def are protected fields in Java 1.5 and 1.6

If you want I can provide you with full source code so you can use it to create 
the necessary updates in 2.x and 2.2 branches.

Doychin

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4199342#4199342

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4199342
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Remoting] - Re: JBoss Remoting and compression

2009-01-03 Thread ron.si...@jboss.com
Hi Doychin,

doychin wrote : 
  | If you want I can provide you with full source code so you can use it to 
create the necessary updates in 2.x and 2.2 branches.
  | 

That would be great.  Could you attach the source files to the JIRA issue at 
https://jira.jboss.org/jira/browse/JBREM-1077?

Thanks,
Ron

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4199378#4199378

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4199378
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Remoting] - Re: JBoss Remoting and compression

2009-01-03 Thread doychin
You can find the source code of compression invoker marshaller/unmarshaller  as 
attachments in the JIRA report.

Doychin

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4199384#4199384

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4199384
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Remoting] - Re: JBoss Remoting and compression

2009-01-03 Thread ron.si...@jboss.com
Thanks!

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4199386#4199386

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4199386
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Remoting] - Re: JBoss Remoting and compression

2008-12-31 Thread ron.si...@jboss.com
Hi Doychin,

Thank you for looking into this problem.

doychin wrote : 
  | The problem comes from some extra bytes put in the output stream from 
compression and not read from decompression.
  | 

Comparing the version of CompressingMarshaller on the 2.2 branch (from which 
release 2.2.2.SP8 was derived) with the version on the 2.x branch (from which 
2.4/2.5 releases are derived) I see that there's a problem which I fixed only 
on the 2.x branch.  In particular, CompressingMarshaller.write() ends


  |   gzos.finish();
  |   oos.flush();
  | 

on the 2.2 branch and it ends


  |   oos.flush();
  |   bos.flush();
  |   gzos.flush();
  |   gzos.finish();
  | 

on the 2.x branch.  I suspect that calling gzos.finish() before oos.flush() is 
what leaves extra bytes unwritten.  Could you try running with the 2.x version 
and see if that fixes the problem?

doychin wrote : 
  | Also another problem I found with current solution is that it leaks lots of 
memory when it is used to transfer big amounts of data for short period of 
time. The reason is that GZip streams depend on some native code routines in 
JVM and to release the resources used by these routines streams depend on the 
garbage collector to call their finalize methods. 
  | 

I did not know that.  I see that David Lloyd made a suggestion on thread 
Compression marshalling 
(http://www.jboss.com/index.html?module=bbop=viewtopict=134557postdays=0postorder=ascstart=10).
  Perhaps his suggestion is directed at this issue.



View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4199010#4199010

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4199010
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user


[jboss-user] [Remoting] - Re: JBoss Remoting and compression

2008-12-31 Thread ron.si...@jboss.com
I created JIRA issue JBREM-1077 Fix problem in CompressingMarshaller 
(https://jira.jboss.org/jira/browse/JBREM-1077) for this problem.

View the original post : 
http://www.jboss.com/index.html?module=bbop=viewtopicp=4199012#4199012

Reply to the post : 
http://www.jboss.com/index.html?module=bbop=postingmode=replyp=4199012
___
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user