5 ms·
What is wrong with restarting your application? Edit: Real Hotswapping will requires profound changes to the memory model. It would introduce too much complexi
by einrealist 12y ago
What is wrong with restarting your application?
Edit: Real Hotswapping will requires profound changes to the memory model. It would introduce too much complexity. I rather restart my application than to suffer from a fragile and leaking platform.
- tieTYT 12y agoIt can take up to 5 minutes to restart my application.
- einrealist 12y agoCan't you just break things up to see them in action? If not, you should question your architecture.
- Roboprog 12y agoSo run multiple instances of the app, and put some kind of load balancer / proxy in front of the instances. Unfortunately, this will require externalization of state data, but if you can't be down for 5 minutes, that's what you need to do. You probably only need one large server running the instances, rather than a cluster. Java apps don't seem to do well -- longer GC pauses -- when they have over 2 GB of memory, anyway, so run multiple instances of "small" apps on a server with say 12 cores. A single server with a large pool of RAM shared between a large number of cores can do pretty amazing things with a collection of "small" programs on it (DB, web service apps, message queue server, web servers) Of course, I'm assuming said server isn't Windows...
- winterbe 12y agoI don't think he meant hotswapping in productive environments but during development. Load balancing doesn't help here. The webapp I'm working on currently has a startup time of 50s on my macbook. If I restart the webapp 100 times a day, thats a total waiting time of 30+ minutes. Our team is 6 developers, so we loose 3h per day. Real hotswapping may be extremely complex but IMO it would be absolutely worth the effort.
- Roboprog 12y agoAh, gotcha. It's funny, I used to do very frequent tests like that when I worked in C (particularly the first few years in the language), but tend to do much fewer test runs in Java. Fewer fatalities, but longer build/start times, I guess.
- haddr 12y agoof course you can restart your app, but it's not sufficient answer to the problem. Apparently long time ago hot swapping was scheduled around Java 9, but they didn't progress with it since then. See JEP-159 for more details: http://openjdk.java.net/jeps/159 http://openjdk.java.net/jeps/159