5 ms·
I'm deeply missing hot swapping. I believed it could be included in java 9 but i think we have to wait...
by haddr 12y ago
I'm deeply missing hot swapping. I believed it could be included in java 9 but i think we have to wait...
- curiousCoffee 12y agoWhat is hot swapping?
- ZoFreX 12y agoReplacing code while it's running. Currently this is possible but quite limited in the official JDK, you can only replace the contents of method bodies. Edit: Demo of it in action here, notch is rapidly developing a game in Eclipse by changing the code while it's running: https://www.youtube.com/watch?v=rhN35bGvM8c https://www.youtube.com/watch?v=rhN35bGvM8c
- exabrial 12y agoThere's always JRebel!
- pjmlp 12y agoNot really. http://zeroturnaround.com/blog/goodbye-liverebel/ http://zeroturnaround.com/blog/goodbye-liverebel/
- curiousCoffee 12y agoOh, damn! I just started using jrebel.. (I know I asked what hotswapping was but I was curious if the OP meant hotswapping in the same way as jrebel or something else) edit: Wait, that is liverebel, not jrebel
- pjmlp 12y agoAh, sorry! I though liverebel was the new name.
- andor 12y agonotch is rapidly developing a game in Eclipse He's modifying the Swing object tree from the main thread! Don't do that, Swing isn't thread safe ;-) https://www.youtube.com/watch?v=rhN35bGvM8c#t=1454 https://www.youtube.com/watch?v=rhN35bGvM8c#t=1454 http://docs.oracle.com/javase/7/docs/api/javax/swing/package-summary.html#threading http://docs.oracle.com/javase/7/docs/api/javax/swing/package...
- exelius 12y agoIsn't this basically what Spring is for? I get that it's not included in the language itself, but that seems more like a feature that should be provided by a framework rather than the language itself...
- tootie 12y agoNo, that's not part of Spring. It would be implemented by a container. OSGi was a sort of failed attempt at standardizing it. Right now you have to pay for something like jrebel (worth it, IMO) to get hot swapping.
- mdaniel 12y agoAre you aware of DCEVM? https://github.com/DCEVM/DCEVM#readme https://github.com/DCEVM/DCEVM#readme
- einrealist 12y agoWhat 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.
- karianna 12y agoZeroTurnaround have a payware product (that's highly acclaimed in this space) called JRebel. It swaps out bytecode directly as opposed to using Java's (somewhat broken) classloader mechanism.