There was a discussion about this ability of the JVM to perform
'hotswaps', that deserved a closer look...
- This ability is natively provided by JVM in debug mode. Feature
available since JDK 1.4.2 (Alex's favourite Java release :)) provided
via the Java Debug Interface
(http://java.sun.com/j2se/1.4.2/docs/guide/jpda/jdi/com/sun/jdi/VirtualMachine.html)
- Redefine (also known as "HotSwap") was added in 1.4.2:
http://java.sun.com/j2se/1.4.2/docs/guide/jpda/enhancements.html
This new feature encapsulates the ability to substitute modified code
in a running application through the debugger APIs. For example, one
can recompile a single class and replace the old instance with the new
instance.
This change was made to address these issues:
* Tool (IDE) vendors want the ability to do fix-and-continue debugging.
That is, while debugging, identify a problem, fix it, and continue
debugging with fixed code.
* Organizations deploying long running servers wish to be able to fix
bugs without taking down the server.
HotSwap adds functionality to the JavaTM Platform Debugger Architecture
(JPDA) to allow a class to be updated while under the control of a
debugger. The two central components of this functionality are
RedefineClasses which replaces the class definitions and PopFrame which
pops frames off the stack allowing a method which has been redefined to
be re-executed.
In the reference implementation, this functionality is implemented at
the Java Virtual Machine Debug Interface (JVMDI) layer and made
available through the higher layers of JPDA - the Java Debug Wire
Protocol (JDWP) and the Java Debug Interface (JDI).
Redefinition Functionality offered:
JDI VirtualMachine.redefineClasses(Map classToBytes)
JDWP RedefineClasses (Cmd 18) in VirtualMachine (CmdSet 1)
JVMDI RedefineClasses(jint classCount, JVMDI_class_definition
*classDefs)
According to the above, HotSwap (on-the-fly class redefinition) can
happen only in debug mode. I guess it can't be natively run in normal
deployed mode, because I assume that Sun thinks that if the application
is already running and deployed, them this hotswap support is not
needed. Deployed version is a deployed one, no need to change it,
unless you're currently developing it :).
So, the rule should be, if you're developing, always run your
applications in debug mode to rip the benefits of JVMs hotswap
(on-the-fly class redefinition).
Also, this hotswap can have a dark side, that is, can take up resources
incrementaly while in this debugging session, that is, the old (already
redefined classes) can be left there and take memory resources, so
memory exceptions can take place, but from my experience, this does not
occur very often (i have used WTP in this mode for 1 day, without
having a single memory exception; assumed that the memory settings of
the JVM are properly set). However, having a practice of ocasional
restart in debug mode, is always a good idea :)
For the WTP context, to put it in a 'productive development mode',
you'll need to make two changes:
- set reloadable="false" on your eclipse configured server, for your
application context
- always use debug mode during development
* Interesting development* : HotSwapping with ANT (using Ant task):
- Defines a hotswap target for Ant that allows your build file to
replace class definitions on a running JVM.
(https://hotswap.dev.java.net/
- java.net incubator project)
Hope this helps,
Ice

Ice's blog

Posted by aaa on декември 14, 2009 at 01:24 PM GMT #
Posted by mbt on септември 15, 2011 at 06:12 AM GMT #
Posted by rickyjake on ноември 08, 2011 at 09:41 AM GMT #
Posted by elmarie on ноември 17, 2011 at 09:32 AM GMT #
Posted by arnoldoh on ноември 17, 2011 at 09:34 AM GMT #
Posted by polard85 on ноември 22, 2011 at 07:56 AM GMT #
Posted by australia ugg boots on декември 12, 2011 at 05:23 AM GMT #
Posted by Diet Solutions on декември 21, 2011 at 11:24 PM GMT #
Posted by Thelma Carter on март 16, 2012 at 01:07 AM GMT #
Posted by Freddie Husltin on март 16, 2012 at 01:28 AM GMT #
Posted by Fake Degree on мај 13, 2012 at 07:02 AM GMT #
Posted by Eric Moran on мај 29, 2012 at 01:28 AM GMT #
Posted by normanbass on јули 20, 2012 at 05:38 AM GMT #
Posted by Diplomas on јули 21, 2012 at 06:22 AM GMT #
Posted by jfsdfjsadkfvmdsf on јули 26, 2012 at 06:22 AM GMT #
Posted by jdsfierndskf on октомври 17, 2012 at 09:40 AM GMT #
Use only under the neck to the chest and abdomen between the feather, soft and high water, and thinner and lighter than the feather came. So, not only thin, light and more comfortable stretching activities. Do not believe, then, to find a vacuum beng compression, intuitive experience will be able to Moncler characteristics
Frances leading straight down garments brand name MonclerGrenoble, 2011 extended straight down coat for girls collection in lots of information mirror the particular snowboarding beginnings: sheepskin liners and also wide lace, create material Moncler Coats opaque feel, ribbed jumper Alpaca or perhaps laminated made of wool creation boost jumper or perhaps jumper inside Great britain type. Abundant and also multi-colored vivid shade, robust. Cozy shade layout motivated from the fragile, apparent old style ambiance: wine beverages reddish, strong yellowish and also greyish environmentally friendly.
2011moncler feminine funds straight down outerwear attire basics, built to become equally type and also engineering, imaginative attractiveness and also powerful com. Garments staying with the particular standard type permeated together with the thought of MonclerGrenoble, as well as the modern day. Concurrently, the outer lining following your waterproofing therapy regarding Tweed Cloth in addition has recently been followed, thermoplastic snowboarding jeans and also part stretchy running snowboarding bundles are produced from this kind of substance. Moncler feminine funds straight down outerwear Hoodie to be able to place the pinnacle, level Moncler Outlet of resistance to be able to cool wind flow. Things may be piled and also along with cozy sporting natural cotton engineering, Moncler Sale released an original create sleeping pad substance. Moncler store feminine straight down although nonetheless http://www.outletmonclerjacketsoutlet.com/ making use of purple velvet, creatItaly straight down coat brand name (Moncler jackets) ThomBrowne collection of developers on the PiscinaCozzi Ground inside LuigiSecchi (the Memorial has been integrated 1934 and also has been rebuilt previous year), provides arranged a particular displays, best manifestation regarding year summer season sports-themed spring/summer 10 new services. elizabeth powerful clothes.
Posted by Moncler Outlet on декември 08, 2012 at 08:13 AM GMT #
Posted by California lawyers bankruptcy on јануари 25, 2013 at 10:01 AM GMT #
Posted by mosaic medallion on февруари 06, 2013 at 06:36 AM GMT #
Posted by African Artefacts on февруари 12, 2013 at 03:59 PM GMT #