diff options
author | Siri Hansen <[email protected]> | 2011-08-29 15:58:45 +0200 |
---|---|---|
committer | Siri Hansen <[email protected]> | 2011-08-30 09:51:35 +0200 |
commit | 7ee8080d1127b30c935dfd896a8e78b3a34ee176 (patch) | |
tree | f02552d2d2d311dfd250bd28faf731ba6cdfc410 /lib/sasl/doc/src/release_handler.xml | |
parent | 9a52e239698ae62cddbc0d780502c72458867b6f (diff) | |
download | otp-7ee8080d1127b30c935dfd896a8e78b3a34ee176.tar.gz otp-7ee8080d1127b30c935dfd896a8e78b3a34ee176.tar.bz2 otp-7ee8080d1127b30c935dfd896a8e78b3a34ee176.zip |
Improve performance of upgrade when many processes have old code
This commit utilizes the new bif erlang:check_old_code/1 to check if a
module has old code in the system or not before running
erlang:check_process_code/2. This is to optimize
release_handler:install_release (and
release_handler:check_install_release).
A new test is added which checks that after traversing all
processes/modules once and purging all old code, the second run
through this part of the code is "sufficiently" much faster.
A note is also added in the reference manual for
release_handler:install_release about how to go around the efficiency
problem of this function.
Diffstat (limited to 'lib/sasl/doc/src/release_handler.xml')
-rw-r--r-- | lib/sasl/doc/src/release_handler.xml | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/lib/sasl/doc/src/release_handler.xml b/lib/sasl/doc/src/release_handler.xml index 4a973bc5ed..2781412848 100644 --- a/lib/sasl/doc/src/release_handler.xml +++ b/lib/sasl/doc/src/release_handler.xml @@ -4,7 +4,7 @@ <erlref> <header> <copyright> - <year>1996</year><year>2009</year> + <year>1996</year><year>2011</year> <holder>Ericsson AB. All Rights Reserved.</holder> </copyright> <legalnotice> @@ -299,6 +299,26 @@ release_handler:set_unpacked(RelFile, [{myapp,"1.0","/home/user"},...]). <c>{update_paths,true}</c>, afterwards <c>code:lib_dir(myapp)</c> will return <c>/home/user/myapp-1.0</c>.</p> + <note> + <p>Before a new release is installed, the + <c>release_handler</c> checks that no processes have + references to old code of any of the modules that are to be + loaded. This operation can be very time consuming, + especially if there are many processes in the system, since + it might cause garbage collections and copying of data.</p> + <p>If it is desirable to reduce the time spent in this + function, then <seealso + marker="#check_install_release/1">check_install_release/1</seealso> + might be called first. This function does the same check for + old code, including garbage collection, and can be done in + the background before actually starting the upgrade by + calling <c>install_release</c>.</p> + <p>Code might even be purged (using + <c>code:purge/1</c>) after + <c>check_install_release</c> in order to completely + avoid the check for old code during + <c>install_release</c>.</p> + </note> </desc> </func> <func> |