Discussion:
How to reduce Jersey-Client footprint
António Mota
2011-12-06 18:03:40 UTC
Permalink
Hi again.

Now my applet using the Jersey-Client is working quite well, however with
all the Jar dependencies is now above 100Mb... Is there a way to reduce
this size, besides removing the jars one by one and see if it works?


Cheers.
**
*
*
Pavel Bucek
2011-12-07 08:32:46 UTC
Permalink
Hello,

100 MB? That definitely doesn't sound right, Jersey client dependencies
shouldn't have more than 3MB in total.. depends on what do you need, but
in most common cases it should work with jersey-client and jersey-core.
You might want to add jersey-json and jackson libs if you are processing
json, but even that is maybe like ~5MB ..

Can you post list of your dependencies? (mvn dependency:tree)

Pavel
Post by António Mota
Hi again.
Now my applet using the Jersey-Client is working quite well, however
with all the Jar dependencies is now above 100Mb... Is there a way to
reduce this size, besides removing the jars one by one and see if it
works?
Cheers.
*/
/*
António Mota
2011-12-12 14:57:48 UTC
Permalink
My mistake, it's about 15Mb, not 100... and that includes another big lib
I'm using, ICEpdf and dependencies, and my own code of course.

Nevertheless too big, I'll have to bring that down.


Thanks.
Post by Pavel Bucek
Hello,
100 MB? That definitely doesn't sound right, Jersey client dependencies
shouldn't have more than 3MB in total.. depends on what do you need, but in
most common cases it should work with jersey-client and jersey-core. You
might want to add jersey-json and jackson libs if you are processing json,
but even that is maybe like ~5MB ..
Can you post list of your dependencies? (mvn dependency:tree)
Pavel
Hi again.
Now my applet using the Jersey-Client is working quite well, however
with all the Jar dependencies is now above 100Mb... Is there a way to
reduce this size, besides removing the jars one by one and see if it works?
Cheers.
*
*
Pavel Bucek
2011-12-12 15:21:11 UTC
Permalink
$ ls -alh
./trunk/jersey/jersey-client/target/jersey-client-1.12-SNAPSHOT.jar
-rw-r--r-- 1 pavel staff 127K Dec 12 10:28
./trunk/jersey/jersey-client/target/jersey-client-1.12-SNAPSHOT.jar
$ ls -alh ./trunk/jersey/jersey-core/target/jersey-core-1.12-SNAPSHOT.jar
-rw-r--r-- 1 pavel staff 451K Dec 12 10:28
./trunk/jersey/jersey-core/target/jersey-core-1.12-SNAPSHOT.jar

so 576kB in total. And there is some opportunity to shrink it (excluding
some classes from jersey-core). You should be able to create something
like "jersey-client-repackaged-bundle" which would contain just classes
for your specific purpose..

Pavel
Post by António Mota
My mistake, it's about 15Mb, not 100... and that includes another big
lib I'm using, ICEpdf and dependencies, and my own code of course.
Nevertheless too big, I'll have to bring that down.
Thanks.
Hello,
100 MB? That definitely doesn't sound right, Jersey client
dependencies shouldn't have more than 3MB in total.. depends on
what do you need, but in most common cases it should work with
jersey-client and jersey-core. You might want to add jersey-json
and jackson libs if you are processing json, but even that is
maybe like ~5MB ..
Can you post list of your dependencies? (mvn dependency:tree)
Pavel
Post by António Mota
Hi again.
Now my applet using the Jersey-Client is working quite well,
however with all the Jar dependencies is now above 100Mb... Is
there a way to reduce this size, besides removing the jars one by
one and see if it works?
Cheers.
*/
/*
Gerard Davison
2011-12-16 13:43:48 UTC
Permalink
Our of interest I ran pak200 on the 1.8 jars I have handing around and it got it down to around 140kb for both, might help with your other dependencies.

Gerard

http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/tools/pack200.html
$ ls -alh ./trunk/jersey/jersey-client/target/jersey-client-1.12-SNAPSHOT.jar
-rw-r--r-- 1 pavel staff 127K Dec 12 10:28 ./trunk/jersey/jersey-client/target/jersey-client-1.12-SNAPSHOT.jar
$ ls -alh ./trunk/jersey/jersey-core/target/jersey-core-1.12-SNAPSHOT.jar
-rw-r--r-- 1 pavel staff 451K Dec 12 10:28 ./trunk/jersey/jersey-core/target/jersey-core-1.12-SNAPSHOT.jar
so 576kB in total. And there is some opportunity to shrink it (excluding some classes from jersey-core). You should be able to create something like "jersey-client-repackaged-bundle" which would contain just classes for your specific purpose..
Pavel
My mistake, it's about 15Mb, not 100... and that includes another big lib I'm using, ICEpdf and dependencies, and my own code of course.
Nevertheless too big, I'll have to bring that down.
Thanks.
Hello,
100 MB? That definitely doesn't sound right, Jersey client dependencies shouldn't have more than 3MB in total.. depends on what do you need, but in most common cases it should work with jersey-client and jersey-core. You might want to add jersey-json and jackson libs if you are processing json, but even that is maybe like ~5MB ..
Can you post list of your dependencies? (mvn dependency:tree)
Pavel
Post by António Mota
Hi again.
Now my applet using the Jersey-Client is working quite well, however with all the Jar dependencies is now above 100Mb... Is there a way to reduce this size, besides removing the jars one by one and see if it works?
Cheers.
António Mota
2011-12-16 15:15:58 UTC
Permalink
That looks great, thanks a million.
Post by Gerard Davison
Our of interest I ran pak200 on the 1.8 jars I have handing around and it
got it down to around 140kb for both, might help with your other
dependencies.
Gerard
http://docs.oracle.com/javase/6/docs/technotes/guides/jweb/tools/pack200.html
$ ls -alh
./trunk/jersey/jersey-client/target/jersey-client-1.12-SNAPSHOT.jar
-rw-r--r-- 1 pavel staff 127K Dec 12 10:28
./trunk/jersey/jersey-client/target/jersey-client-1.12-SNAPSHOT.jar
$ ls -alh ./trunk/jersey/jersey-core/target/jersey-core-1.12-SNAPSHOT.jar
-rw-r--r-- 1 pavel staff 451K Dec 12 10:28
./trunk/jersey/jersey-core/target/jersey-core-1.12-SNAPSHOT.jar
so 576kB in total. And there is some opportunity to shrink it (excluding
some classes from jersey-core). You should be able to create something like
"jersey-client-repackaged-bundle" which would contain just classes for your
specific purpose..
Pavel
My mistake, it's about 15Mb, not 100... and that includes another big lib
I'm using, ICEpdf and dependencies, and my own code of course.
Nevertheless too big, I'll have to bring that down.
Thanks.
Post by Pavel Bucek
Hello,
100 MB? That definitely doesn't sound right, Jersey client dependencies
shouldn't have more than 3MB in total.. depends on what do you need, but in
most common cases it should work with jersey-client and jersey-core. You
might want to add jersey-json and jackson libs if you are processing json,
but even that is maybe like ~5MB ..
Can you post list of your dependencies? (mvn dependency:tree)
Pavel
Hi again.
Now my applet using the Jersey-Client is working quite well, however
with all the Jar dependencies is now above 100Mb... Is there a way to
reduce this size, besides removing the jars one by one and see if it works?
Cheers.
*
*
Loading...