Java Performance Tuning

Errata for Java Performance Tuning

Submit your own errata for this product.


The errata list is a list of errors and their corrections that were found after the product was released. If the error was corrected in a later version or reprint the date of the correction will be displayed in the column titled "Date Corrected".

The following errata were submitted by our customers and approved as valid errors by the author or editor.

Color Key: Serious Technical Mistake Minor Technical Mistake Language or formatting error Typo Question Note Update



Version Location Description Submitted By Date Submitted Date Corrected
Printed
Page 109

Lines 3&4 used to read: clears them. Basically, the garbage collector does not clear WeakReference objects until all SoftReferences have been cleared. PhantomReferences They now read: clears them. Basically, the garbage collector does not clear SoftReference objects until all WeakReferences have been cleared. PhantomReferences Lines 8&9 used to read: to be used for caches that may need to have memory automatically freed, and WeakReferences are intended for canonical tables that may need to have They now read: to be used for canonical tables that may need to have memory automatically freed, and WeakReferences are intended for caches that may need to have

Anonymous    Jan 01, 2001
Printed
Page 117

Line 12 used to read: int[][] array2 = (int[])Ref_array2.clone();//faster than initializing It now reads: int[][] array2 = (int[][])Ref_array2.clone();//faster than initializing

Anonymous    Jan 01, 2001
Printed
Page 133
In the lines from

"private static final intfloatSignMask = 0x80000000;" to: "private static final intfloatExpBias = 127;" A space has been entered between "int" and "float" for the code to be correct.

Anonymous    Aug 01, 2001
Printed
Page 137
The originally published double to string conversion

algorithm scaled values by one order of magnitude too much, resulting in some numbers overflowing and so converting incorrectly. This has also been corrected in the associated source and byte-code files. Lines 11 to 14 from the bottom of the page used to read: i = (long) (d*1E19 / d_magnitudes[magnitude + 324]); else i = (long) (d / d_magnitudes[magnitude + 323 - 18]); i = i%100 >= 50 ? (i/100) + 1 : i/100; They now read: i = (long) (d*1E18 / d_magnitudes[magnitude + 324]); else i = (long) (d / d_magnitudes[magnitude + 323 - 17]); i = i%10 >= 5 ? i/10 + 1 : i/10; And on p. 136, lines 6-8 from the bottom used to read (3 lines): if (i != 0) s.append(charForDigit[(int) i]); decimalOffset--; They now read (nine lines): if (i != 0) s.append(charForDigit[(int) i]); else if (decimalOffset > 0) { s.append(ZEROS[decimalOffset]); //ZEROS[n] is a char array of n 0's decimalOffset = 1; } decimalOffset--;

Anonymous    Jan 01, 2001
Printed
Page 176

Existing code line: public static final Class FOO_BAR_CLASSNAME = Class.forName("foo.bar.ClassName"); should read public static final Class FOO_BAR_CLASSNAME = foo.bar.ClassName.class; Text below that: Existing paragraph: Note that foo.bar.ClassName.class is a valid construct to refer to the foo.bar.ClassName class object. However, the compiler generates a static method that calls Class.forName( ) and replaces the foo.bar.ClassName.class construct with a call to that static method. So it is better to use the FOO_BAR_CLASSNAME static variable as suggested, rather than: Should be - Note that foo.bar.ClassName.class is a valid construct to refer to the foo.bar.ClassName class object. However, the compiler generates a static method that calls Class.forName( ) and replaces the foo.bar.ClassName.class construct with a call to that static method. So if the contruct will be accessed more than once, it is better to use the FOO_BAR_CLASSNAME static variable as suggested, rather than:

Anonymous   
Printed
Page 273
The footnote has been replaced with the following

"ThreadLocal variables might be appropriate here, but not in JDK 1.2 which used an underlying implementation of a synchronized map to allocate per-thread objects. That implementation would defeat our intention to avoid synchronization completely. JDK 1.3 uses an instance variable in the Thread object to hold an unsynchronized map and so would work."

Anonymous    Aug 01, 2001
Printed
Page 406
In the URLs Section

hhtp://www.inetmi.com/~gwhi/ProfileViewer/ProfileViewer.html Has been changed to: http://www.capital.net/~dittmer/profileviewer/index.html

Anonymous    Aug 01, 2001
Printed
Page 407
In the Profilers Section,

The following URL has been deleted: http://www.eqase.com

Anonymous    Aug 01, 2001