Go Back   Velocity Reviews > Newsgroups > Java
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Java - Develop Update Server in Java

 
Thread Tools Search this Thread
Old 10-29-2009, 10:58 PM   #11
Default Re: Develop Update Server in Java


On Wed, 28 Oct 2009 14:13:41 +0100, Simon <>
wrote, quoted or indirectly quoted someone who said :

>Dear all,
>
>I am looking for ideas, patterns, practices to develop a client/server
>architecture that can be used to update clients when a new release is
>uploaded to the server. Does anyone know any web resources considering
>this topic? (WebStart is not what I want.)
>
>(Yes, I know Google, but "update sever java" is not a good query string )
>
>Cheers,
>Simon


See my student project outlines:
http://mindprod.com/project/deltacreator.html
http://mindprod.com/project/prebrand...arerental.html
http://mindprod.com/project/autoupdate.html
--
Roedy Green Canadian Mind Products
http://mindprod.com

When your language is nowhere near Turing-complete, syntactic sugar can be your friend.
~ Eric S. Raymond (born: 1957-12-04 age: 51) The Cathedral and the Bazaar


Roedy Green
  Reply With Quote
Old 10-30-2009, 08:04 AM   #12
Simon
 
Posts: n/a
Default Re: Develop Update Server in Java
> Why must you bundle the JRE?
>
> Why can't the user use their own?


Because people don't know what a JRE actually is? Telling the user to go
to Sun's web page and try to find the suitable download for their system
will loose half the people on the way.

(Of course those who do know can download an unbundled version.)

I wasn't aware of the deployJava.js script Andrew mentions. That may
solve the problem.

Cheers,
Simon



Simon
  Reply With Quote
Old 10-30-2009, 08:06 AM   #13
Simon
 
Posts: n/a
Default Re: Develop Update Server in Java
Andrew Thompson wrote:

[some good examples and links]

I wasn't aware of these things, thanks Andrew. I may change my mind
about, can't guarantee the rest of us will, however


Simon
  Reply With Quote
Old 10-30-2009, 08:19 AM   #14
Simon
 
Posts: n/a
Default Re: Develop Update Server in Java
Thanks all for your answers. Mabe I'll change my opinion on JWS.

Some more things:

- I know that you can specify heap size with JWS. But is it possible to
set the heap size to some percentage of the free memory (at the time it
is launched)?

- Is it possible to let the user define a heap size from inside the
application? (Not inside some JWS configuration tool?)

- The application consists of two parts, one with a GUI and one command
line version. The latter will often be scheduled by cron or some other
tool on machines that may not even have a display. Will the user have to
enter "javaws -something" as the command to be executed by its scheduler
or can I provide some less confusable executable? At best this
executable would not be placed somewhere deeply hidden in a JWS directory.

- In the task manager on Windows, what do you see when you launch a JWS
application? "javaws" or the application name?

Best,
Simon


Simon
  Reply With Quote
Old 10-30-2009, 04:12 PM   #15
markspace
 
Posts: n/a
Default Re: Develop Update Server in Java
Lew wrote:
> Simon wrote:
>> - I know that you can specify heap size with JWS. But is it possible
>> to set the heap size to some percentage of the free memory (at the
>> time it is launched)?

>
> It isn't necessary or useful. On many OSes, such as some Linuces, there
> isn't any "free" memory. The OS fills it all with program pages and
> caches, swapping out as demanded. You might see 50 KiB of "free" memory
> yet safely can allocate 1 GiB of heap.
>



This.

A swap file is used on any modern OS. I can (and have) run multiple JVM
instances set for 1.2 Gigs on my 2 Gig machine. Even with 10 of them
running, they all work just fine. So set your heap limit to what you
know works for your app, and let the OS figure it out.

There may be some corner-cases where this doesn't work (netbooks? Micro
edition?) but if you're running desktop apps then I'm sure that this
will work for more than 99.999% of your users.



markspace
  Reply With Quote
Old 10-30-2009, 04:59 PM   #16
Simon
 
Posts: n/a
Default Re: Develop Update Server in Java
>> It isn't necessary or useful.

As is any fixed number defined at deploy time.

>> On many OSes, such as some Linuces,
>> there isn't any "free" memory. The OS fills it all with program pages
>> and caches, swapping out as demanded.


On Windows, building a native launcher, this works well.

> A swap file is used on any modern OS. I can (and have) run multiple JVM
> instances set for 1.2 Gigs on my 2 Gig machine. Even with 10 of them
> running, they all work just fine. So set your heap limit to what you
> know works for your app, and let the OS figure it out.


There is no such number. It is a data analysis tool. If the user decides
to process an 8GB gene data file, then you need 8GB. Still, setting the
heap size to 8GB in general is not a good idea since Java will simply
not start if the machine does not have 8GB. More importantly, if the
heap size is too large and the OS starts to swap, this is worse than
getting an OutOfMemoryError. Swapping will almost freeze the app with no
chance of telling the user what the actual problem is.

Best,
Simon


Simon
  Reply With Quote
Old 10-30-2009, 05:30 PM   #17
markspace
 
Posts: n/a
Default Re: Develop Update Server in Java
Simon wrote:
> There is no such number. It is a data analysis tool. If the user decides
> to process an 8GB gene data file, then you need 8GB. Still, setting the



Well, you can't set an 8Gb heap size on a 32 bit JVM period. It's
limited to about 1.2G to 1.4G, depending on other parameters.


> heap size to 8GB in general is not a good idea since Java will simply
> not start if the machine does not have 8GB. More importantly, if the



Have you actually tried this? Because I don't think it works the way
you say.

On a 64 bit JVM, you can set 8Gb regardless of physical memory. The OS
just uses the swap file for any "extra" memory that it needs. That's
what virtual memory does. It effectively converts disc memory into RAM.
So you can most definitely set an 8Gb heap size on a machine with less
physical memory.


> heap size is too large and the OS starts to swap, this is worse than
> getting an OutOfMemoryError. Swapping will almost freeze the app with no
> chance of telling the user what the actual problem is.


Have you actually seen this kind of swapping (what most folks call
"thrashing") on your app? I doubt it, because I don't think you're
actually testing with a 64 bit JVM.

However, if you have seen this behavior, there's garbage collector
tweaks you can use to alleviate it. I'd have to dig through the docs to
find them, but they're there. It might be worth checking in to if you
really think you need high amounts of JVM memory.




markspace
  Reply With Quote
Old 10-30-2009, 07:22 PM   #18
markspace
 
Posts: n/a
Default Re: Develop Update Server in Java
Peter Duniho wrote:

> For what it's worth, the previous poster didn't actually write "physical
> memory". It might have been what he meant, but he also might have
> simply meant "does not have 8GB of memory".



That may be true. However, in my test, I made 10 JVM's with 1.2 Gig
each as the heap limit. My swap file has about 2x my physical memory,
for about 6 Gigs total. Yet I had 1.2G x 10 = 12 Gigs "allocated".

The heap limit is just that -- a limit. The JVM does not go out and
Bogart 8 Gig of memory as soon as you start it up, it just does not ever
allocate more than 8 Gigs.

So I believe that a JVM with a 8 Gig heap limit could be started on a
machine with less than 8 Gigs total available. You'd just never get to
the 8 Gig limit, the OS would stop allocating memory for you first.
Although I admit I have not tried this.

The confusion comes in, I think, when one tries to allocate 1.8 Gigs or
more on a 32 bit JVM, like most desktop JREs. The 32 bit JVM cannot
physically handle that much memory, period, so it issues an error
message immediately.

>
> And when running in a VM environment, "memory" really means "disk
> space". The physical memory is really just a cache of sorts; the disk



The disc cache on a VM system is usually referred to as the "backing
store." That's an old name, but I still see it used. The "swap file"
is an implementation of the backing store. "A cache of sorts" is... not
often used in the technical literature. Just sayin'.



markspace
  Reply With Quote
Old 10-30-2009, 08:38 PM   #19
markspace
 
Posts: n/a
Default Re: Develop Update Server in Java
Peter Duniho wrote:

> What OS?


Windows Vista.


> I admit, I don't know the exact implementation of the JVM. But I doubt
> it's as you say. If it were, there would be no need to specify a limit
> at all, and the default would just be the theoretical maximum size for



Consider the other case: plenty of RAM, (let's say 16 Gigs RAM and 32
Gigs in the backing store) and one wants to limit JVM usage to some
fraction of that. It's pretty common to allocate memory usage on large
servers manually. Say, 2G for the OS, 6G for the JVM, 8Gs for the
database, etc. Memory limits enforce that, without having the OS
terminate a process for exceeding its limit.

There was a big commotion in the MySQL users group meeting I attended
when someone brought up the fact that MySQL memory limit parameters
weren't accurate. You'd often get a little more or a little less memory
used than you asked for. This is a big deal for the bleeding-edge
database admin types, I gather. It kinda shied me alway from using
MySQL too, if they can't control the memory they allocate.


> That directly contradicts your claim that Java doesn't pre-allocate the
> heap. In particular, the only hard limit on 32-bit Windows is the 2GB



No, it just means that the JVM has compiled-in limits, and checks its
parameters first to make sure they're sane. If it finds an illegal
combination, it issue an error message and halts.



markspace
  Reply With Quote
Old 10-31-2009, 01:07 AM   #20
Lew
 
Posts: n/a
Default Re: Develop Update Server in Java
Peter Duniho wrote:
> In other words, if you get a failure starting the 32-bit JVM under
> Windows at some heap size smaller than 2GB, that's a very strong
> indication that Java is in fact pre-allocating the heap.


No, it has to do with address space in a 32-bit pointer. The JVM "knows" that
it needs some memory for itself, so it only allows what's left over for the
"-Xmx" parameter.

GIYF:
<http://java.sun.com/docs/hotspot/HotSpotFAQ.html#gc_heap_32bit>
<http://publib.boulder.ibm.com/infocenter/javasdk/tools/index.jsp?topic=/com.ibm.java.doc.igaa/_1vg00014884d287-11c3fb28dae-7ff6_1001.html>

--
Lew


Lew
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
PC-cillin Update Server Failure SirOsisOfThuliver Computer Support 6 01-03-2004 04:14 AM
64 bit - Windows Liberty 64bit, Windows Limited Edition 64 Bit,Microsoft SQL Server 2000 Developer Edition 64 Bit, IBM DB2 64 bit - new! TEL Computer Support 1 01-01-2004 02:39 PM
windows updates--how to tell which you need? Viewasku1977 Computer Support 41 11-14-2003 03:34 AM
Win2K SP4 - what's the verdict? Max Quordlepleen Computer Support 6 09-16-2003 11:23 AM
Re: windows 2000 sp4 is a must PhilGreg Computer Support 0 07-17-2003 04:38 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46