Java

For discussions about programming, programming questions/advice, and projects that don't really have anything to do with Puppy.
Message
Author
starhawk
Posts: 4906
Joined: Mon 22 Nov 2010, 06:04
Location: Everybody knows this is nowhere...

#21 Post by starhawk »

sunburnt wrote:<snip>

Android is nearly a tablet + desktop O.S. ( amigo called it an interface ).
I`m thinking that making it desktop capable would kill Linux and Weeners.
I know I'm a little late to be commenting on this particular post... but...

http://www.android-x86.org/

;)

It only works on a limited range of computers right now, though...

User avatar
Monsie
Posts: 631
Joined: Thu 01 Dec 2011, 07:37
Location: Kamloops BC Canada

Java

#22 Post by Monsie »

jpeps wrote:I was able to knock 63% off use of RAM with -Xmxn option (n=size). 2m is minimum.

example: in ROX, set run action to:
java -Xmx2m -jar "$@"
Does this tweak only work with certain Java packages? I have Java 1.6.0_33 in Wary Puppy. I modified the application_x-jar script in: /etc/xdg/rox.sourceforge.net/MIME-types with the run action tweak, then ran one of my favorite Java utility programs and I was not able to find any noticeable difference in memory usage at all.

Code: Select all

pmap -x process id
(where process id is the number assigned to the application in Pprocess) showed no significant change in how much memory my Java utility was using. Maybe I am missing something here and/or not understanding the procedure.

Monsie
My [u]username[/u] is pronounced: "mun-see". Derived from my surname, it was my nickname throughout high school.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

Re: Java

#23 Post by jpeps »

Monsie wrote:[

Does this tweak only work with certain Java packages? I have Java 1.6.0_33 in Wary Puppy.
I'm running version 1.7.0_13 (you might as well update...you can run the script). Try running from the terminal, comparing with top -n1. On my sort editor, it loads with 378m with just java -jar. With 20m tweak, it loads with 143m, and with 2m tweak, 129m. It you tweak it too much for the app, it won't run. It it loads with only 2m, you should see a big difference.

User avatar
Monsie
Posts: 631
Joined: Thu 01 Dec 2011, 07:37
Location: Kamloops BC Canada

Java

#24 Post by Monsie »

Thanks, jpeps

Just to let you know that I downloaded your latest Java runtime package, moved it to /mnt/home, however it did not show up in BootManager and so I was not able to load it. The checksum for the download was fine. I tried re-naming the file, thinking that BootManager was filtering the entry for some reason, but no luck there...

Subsequently, I downloaded jre version 1.7.0_13 that TheAsterisk! put together right here and it showed up in BootManager, so I was able to load the package, reboot and run one of my Java apps just fine... In fact, so far I have found that one of my Java programs uses 28 mb less memory without your tweak --an improvement of 11% so it appears that Java 1.7x runs much more efficiently. :)

Anyway, if you can think of any changes to make regarding your Java package (either on your part or mine), I am willing to test it again to see if it will load for me.

Monsie
My [u]username[/u] is pronounced: "mun-see". Derived from my surname, it was my nickname throughout high school.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#25 Post by 01micko »

Monsie

try renaming jpep's jre sfs package adding a hyphen after jre .. bootmanager might be choking on that...
Puppy Linux Blog - contact me for access

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#26 Post by jpeps »

01micko wrote:Monsie

try renaming jpep's jre sfs package adding a hyphen after jre .. bootmanager might be choking on that...


...changed the name; I didn't realize that was a convention.

edit: patched the build script

User avatar
Monsie
Posts: 631
Joined: Thu 01 Dec 2011, 07:37
Location: Kamloops BC Canada

Java

#27 Post by Monsie »

jpeps wrote:
01micko wrote:Monsie

try renaming jpep's jre sfs package adding a hyphen after jre .. bootmanager might be choking on that...


...changed the name; I didn't realize that was a convention.

edit: patched the build script
Yes, I already tried Mick's suggestion when re-naming the Java package, but it didn't work... Then I had a new idea, and also replaced the underscores in the file name... and that did work :)

The interesting thing I noticed is that the devx package has underscores in its name, as does Wary's main package. So, I can see how one might think it's okay to include underscores in third party packages... but apparently not. I am guessing that BarryK made a rule such that BootManager recognizes files with underscores in the name if those files are legitimate operating system packages. There must be a good reason for this, but as to why I can only speculate...

Monsie
My [u]username[/u] is pronounced: "mun-see". Derived from my surname, it was my nickname throughout high school.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#28 Post by jpeps »

Ah..thanks Monsie. I have other packages with underscores as well, besides the devx. I'm guessing you're not using SFS-on-the-Fly, or is it distro dependent? I'll rename again. Did you get the cache limiting option working?

User avatar
Monsie
Posts: 631
Joined: Thu 01 Dec 2011, 07:37
Location: Kamloops BC Canada

Java

#29 Post by Monsie »

jpeps wrote:Ah..thanks Monsie. I have other packages with underscores as well, besides the devx. I'm guessing you're not using SFS-on-the-Fly, or is it distro dependent? I'll rename again. Did you get the cache limiting option working?
I have not tried Shinobar's SFS load on the fly, but I am fairly sure that it works with Wary. If I get back to doing a full install of Puppy, I will probably test it. Do you know if Shino's program is subject to the same limitations with file names as BootManager or will it accept any package with an underscore in the name?

As for your tweak, I tested it on my favorite Java program and was only able to see a reduction in memory usage of 1 mb... However, this application was written for Java 1.4 and therefore might not be able to take full advantage of the tweak. Still, I was happy to see that it ran more efficiently with the new JRE anyway, as I noted in an earlier post.

Monsie
My [u]username[/u] is pronounced: "mun-see". Derived from my surname, it was my nickname throughout high school.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

Re: Java

#30 Post by jpeps »

Monsie wrote: I have not tried Shinobar's SFS load on the fly, but I am fairly sure that it works with Wary. If I get back to doing a full install of Puppy, I will probably test it. Do you know if Shino's program is subject to the same limitations with file names as BootManager or will it accept any package with an underscore in the name?
I don't know if this is unique to Wary, since this was the first I've heard of a Puppy.distro refusing to load underscores.
As for your tweak, I tested it on my favorite Java program and was only able to see a reduction in memory usage of 1 mb... However, this application was written for Java 1.4 and therefore might not be able to take full advantage of the tweak. Still, I was happy to see that it ran more efficiently with the new JRE anyway, as I noted in an earlier post.

Monsie
That's also strange, since it's a standard Java option. Does it work with other java apps? You could try it on posted Sort Editor.

User avatar
Monsie
Posts: 631
Joined: Thu 01 Dec 2011, 07:37
Location: Kamloops BC Canada

Java

#31 Post by Monsie »

Hi jpeps,

Well, I did some more testing... I downloaded MyLibrary.jar and started playing with that, when it dawned on me that I had been tweaking the wrong script file for Java applications...:oops: I had been editing the application_x-jar script, when I should have been looking at the application_x-java-archive script. So, once I got that sorted out, I tested the tweak on your app and achieved a 41.5% reduction in memory usage with the minimum adjustment @ -Xmx2m :D

Then I tested my old, but favorite Java application. Unfortunately the tweak did not work... even at minimum setting. It was kind of weird in that the program would open, but all I got was the window, frame, a couple of buttons, but the rest of the interface was missing. I checked the MANIFEST file, and it turns out that it was created with Java-1.5. and not Java 1.4 like I thought originally. So then... I tested another Java app which did turn out to be version 1.4 and it worked with the tweak... --go figure.

At the very least, I now know that the tweak does not depend on a particular version of Java.... more likely it has to do with the quality of the code.

Monsie
My [u]username[/u] is pronounced: "mun-see". Derived from my surname, it was my nickname throughout high school.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

Re: Java

#32 Post by jpeps »

Monsie wrote: At the very least, I now know that the tweak does not depend on a particular version of Java.... more likely it has to do with the quality of the code.

Monsie
I'm guessing that the app required more cache than you were allowing it.

User avatar
Monsie
Posts: 631
Joined: Thu 01 Dec 2011, 07:37
Location: Kamloops BC Canada

Re: Java

#33 Post by Monsie »

jpeps wrote:
Monsie wrote: At the very least, I now know that the tweak does not depend on a particular version of Java.... more likely it has to do with the quality of the code.

Monsie
I'm guessing that the app required more cache than you were allowing it.
Yes, well I did try several adjustments in 1 mb increments, but each time I got the same result.

For the record, the Java program I am talking about is Character Map which I find very useful in Puppy at times. You can download it at: http://www.psc-consulting.ca/fenske/

Monsie
My [u]username[/u] is pronounced: "mun-see". Derived from my surname, it was my nickname throughout high school.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

Re: Java

#34 Post by jpeps »

Monsie wrote:[

Yes, well I did try several adjustments in 1 mb increments, but each time I got the same result.

For the record, the Java program I am talking about is Character Map which I find very useful in Puppy at times. You can download it at: http://www.psc-consulting.ca/fenske/

Monsie
CharMap ran with a 15M tweak at 140M, and at 379M without. I'm not sure why it's not working on your Wary distro. Did you run it from the terminal to see if anything else is going on?

There's another app, Acento, that does something similar:
http://java-apps.org/

User avatar
Monsie
Posts: 631
Joined: Thu 01 Dec 2011, 07:37
Location: Kamloops BC Canada

Re: Java

#35 Post by Monsie »

jpeps wrote:
Monsie wrote:[

Yes, well I did try several adjustments in 1 mb increments, but each time I got the same result.

For the record, the Java program I am talking about is Character Map which I find very useful in Puppy at times. You can download it at: http://www.psc-consulting.ca/fenske/

Monsie
CharMap ran with a 15M tweak at 140M, and at 379M without. I'm not sure why it's not working on your Wary distro. Did you run it from the terminal to see if anything else is going on?

There's another app, Acento, that does something similar:
http://java-apps.org/
It worked! First, I tried the 15M tweak, and found that it opened properly... but that it was still using the same amount of memory as if no adjustment had been made. Then I bumped it to 16M and saw a drop of 81 mb 8) Wow... thanks for all of your help. :)

PS It would be interesting and useful to know the parameters of the tweak... so as to have an idea as to which values to try first. This way, one might not give up too quickly, as I did after having tried 2m - 8m values initially.

Monsie
My [u]username[/u] is pronounced: "mun-see". Derived from my surname, it was my nickname throughout high school.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

Re: Java

#36 Post by jpeps »

Monsie wrote:
PS It would be interesting and useful to know the parameters of the tweak... so as to have an idea as to which values to try first. This way, one might not give up too quickly, as I did after having tried 2m - 8m values initially.

Monsie
I set mine by default in ROX at 20m. I'd rather have a little extra cache in case it's needed...less isn't always better unless you're running a very old, RAM starved computer.

User avatar
01micko
Posts: 8741
Joined: Sat 11 Oct 2008, 13:39
Location: qld
Contact:

#37 Post by 01micko »

Attached is a great little java vnc viewer by hexabit. I had trouble accessing his site so I'll post it here.

BTW, modded the grabber script to get jre-1.7 update 15 and made an sfs beautifully, uploaded to pet_packages-slacko14 at your favourite puppy mirror.
Attachments
jvnc-1.3.9.pet
be sure to have your vnc server configured!
(160.44 KiB) Downloaded 487 times
capture17447.jpg
(37.49 KiB) Downloaded 763 times
Puppy Linux Blog - contact me for access

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#38 Post by jpeps »

01micko wrote:Attached is a great little java vnc viewer by hexabit. I had trouble accessing his site so I'll post it here.
Very nice! I use VNC, so could test it out. One addition..change line 18 of the viewer to:

Code: Select all

java -Xmx20m -jar VncViewer.jar HOST $host PORT $port
Saves me 235M.

edit: scratch that idea; I needed the extra memory for most connections

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#39 Post by jpeps »

Here's a small java app I wrote for zeroing out files. Run from the console as:

Code: Select all

     zero [file]
or put /usr/local/bin/zero on the desktop and simply drag the file onto it.

note: zeroing out files means overwriting all the characters with zeros so they can't be retrieved.

updated: load from current directory without path
Attachments
zero-1.1.pet
(2.16 KiB) Downloaded 458 times

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#40 Post by jpeps »

Here's an interesting little Webpage Saver. Enter URL as an argument.

edit: Made it even smaller.
Attachments
WebSave.jar.tar.gz
(10.22 KiB) Downloaded 431 times

Post Reply