throbber
ÿS)nxÿ()%)n(ÿy
`  ÿ  
` 
`*+,-./ÿ12345264/273ÿ438ÿ.5-439:
`
ÿ
ÿÿ
`ÿÿ !ÿ"#$$ÿ%&ÿ'()
`;<=ÿ?<ÿ@ABCDEÿFGHBBABÿI<JÿKJ<KAJÿ<LMAF?ÿFGAHENK
`)OÿPQOÿRÿSÿTRÿÿPUÿVÿQWÿTXQÿRRÿTYWQÿZQOÿ
`
`WXÿVÿRÿ[W[ÿQOQÿVWXÿÿ[[ÿQ\QÿQÿQOÿTRRÿV
`heiÿdj_kcÿglm
`ÿTYWQ]ÿV^ÿSÿQOÿ_`abcÿ_decafg_`ÿQWÿS]ÿTÿVWXRÿÿQOÿRÿ[W[
`QOQÿO[ÿ XÿXÿ[[ÿWX[ÿQÿQOÿÿVÿÿTYWQ]ÿV^
`n ÿTYWQÿÿÿÿ[RPÿXÿWP[XQRÿXWÿQOQÿÿVQ^ÿ&QÿTX 
`ÿTYWQÿXÿPÿPP ÿQÿQÿQOÿPRÿÿQOÿO[^ÿo)OÿÿQXÿÿV
`TYWQÿQOQÿWÿÿQWÿT^ÿnWOÿTYWQÿPRÿPXQÿWXÿPÿpÿV
`[QÿQÿWÿQÿÿWÿWXÿQOÿP[PQQU[QÿVPQÿ
`Z^qÿ
XQÿTYWQÿP ÿÿXÿQOÿVQÿXWÿTÿPP ^ÿrÿsP[
`PÿTYWQÿP ÿXÿXWÿXWOÿÿVÿOÿR[OWÿWQsQÿWpQÿÿ
`^ÿOÿ XÿRÿÿTYWQÿ XÿPXQÿPpÿXÿQÿQX ÿÿ ÿVQ
`XWÿQÿXÿÿQOÿ QPÿZ]QÿXÿXQÿVÿQOÿXW^
`
WXÿÿÿÿRTRUWWQÿRXRÿRÿQOÿPP ÿWQÿZQOÿ
`TYWQÿÿ ^ÿ%ÿ XÿÿQÿÿÿQÿRÿVÿÿVWÿQÿQOÿTYWQ^ÿ
WXÿ X
`]QÿOÿQÿZ ÿTXQÿs[WQ ÿVRÿÿTYWQÿÿ XÿPXQÿÿRXRÿXWOÿ
`tÿÿtuuÿ Xÿ]QÿZ ÿTXQÿWX[QRÿPP ÿT ÿWWQ ÿVRÿQOÿP
`TYWQÿQZW^ÿvXÿÿOZÿÿQÿPpÿXÿ XÿWQX ÿÿÿVWÿQ
`QOÿTYWQ^ÿSVÿ Xÿ]Qÿ XÿWÿÿX[ÿZQOÿÿPP ÿpÿYXQÿpÿQOÿPP ÿp
`
`CONFIGIT 1049
`
`1
`
`

`

`long as you release all references to an object, you needn't worry about explicitly
`
`"freeing" that memory.
`
`Similarly, you needn't worry about explicitly freeing any constituent objects referenced
`
`by the instance variables of an object you no longer need. Releasing all references to the
`
`unneeded object will in effect invalidate any constituent object references contained in
`
`that object's instance variables. If the now-invalidated references were the only
`
`remaining references to those constituent objects, the constituent objects will also be
`
`available for garbage collection. Piece of cake, right?
`
`The rules of garbage collection
`
`Although garbage collection does indeed make memory management in Java a lot
`
`easier than it is in C or C++, you aren't able to completely forget about memory when
`
`you program in Java. To know when you may need to think about memory management
`
`in Java, you need to know a bit about the way garbage collection is treated in the Java
`
`you get in a C++LR‘r1gEgrs ERA/hen you forget to explicitly free objects. Nevertheless, so
`
` ÿÿÿ ÿ
` ÿ
 ÿÿ ÿ ÿ ÿ
ÿ ÿ ÿ ÿ
`ÿe!9fgÿ979fÿh
` ÿ ÿ ÿ  ÿ ÿ  ÿ ÿ ÿ ÿ ÿÿ ÿ  ÿ

` ÿ ÿ 
`
` ÿ ÿÿ ÿ  ÿ
ÿ ÿ ÿ ÿ ÿ  
`ÿÿ ÿ  ÿ ÿ ÿ ÿ ÿ ÿ  ÿÿ  ÿ ÿ  ÿ ÿ
`ÿ ÿÿÿÿ  ÿ ÿ ÿ ÿ  ÿ  ÿ
` ÿ ÿ ÿ  ÿ!ÿÿ "  ÿ  ÿ ÿÿ 
`&'(ÿ*+,(-ÿ./ÿ01*210(ÿ3.,,(345.6
`  ÿ  ÿ ÿ ÿ ÿ ÿÿ ÿ ÿÿ  ÿ
`   ÿ ÿ  ÿ  ÿ#ÿ ÿ $ÿ %
`7 ÿ  ÿ  ÿ ÿÿ $ÿ ÿ  ÿÿ8  ÿ ÿ 
`  ÿ ÿÿÿÿ
`ÿ ÿ
` ÿ ÿ ÿ ÿ ÿ 
ÿ ÿ  ÿ ÿ
` ÿ
 ÿÿ8  ÿ9 ÿ$ ÿÿ ÿ ÿÿ ÿ$ÿ  ÿ ÿ  
`ÿ8  ÿ ÿÿ ÿ$ ÿ ÿÿ  ÿÿ ÿ  ÿ  ÿÿ  ÿÿÿ8 
`
  
`:1*210(ÿ3.,,(345.6ÿ5-ÿ6.4ÿ;16<14(<
`9ÿ ÿÿ ÿ$ ÿÿ ÿ ÿ  ÿ ÿÿ ÿ ÿ ÿÿ8 
`=  ÿ> ÿ
  ÿ?8=>ÿ
@ÿ ÿ ÿÿ ÿ ÿÿ ÿÿ 
`  ÿABCDEÿGHIÿJKLMÿNOBCÿOÿPODQOPCÿRSTTCRMSDUÿ9ÿ8  ÿ=  ÿ> 
`
  ÿÿ=>ÿ ÿ ÿ  ÿ ÿ ÿ ÿÿÿ ÿ
`
  ÿÿ  ÿ ÿÿÿ ÿ ÿ ÿ ÿÿ
`  ÿ  ÿ ÿ ÿ9ÿÿÿ
ÿ ÿ ÿ8=>ÿ?ÿ ÿ ÿ " ÿ 
` ÿ8=>@ÿ ÿ V ÿ ÿ
 ÿÿÿ ÿ ÿÿÿÿ   
` 
`Wÿ  ÿ ÿ ÿ  ÿ ÿ ÿ ÿ ÿÿ ÿ ÿ  ÿ ÿÿ9
`8=>ÿ
ÿ ÿ ÿ ÿ ÿÿ ÿÿÿ   ÿ ÿ ÿ8=>ÿ!ÿÿ ÿ 
` ÿ ÿ8=>ÿXSCLÿ ÿ ÿ ÿ ÿÿ ÿ ÿ ÿYZ[Y\]^_`abcaa`a
`
`specifications.
`
`Garbage collection is not mandated
`
`The first thing to know is that no matter how diligently you search through the Java
`
`Virtual Machine Specification (JVM Spec), you won't be able to find any sentence that
`
`commands, Every JVM must have a garbage collector. The Java Virtual Machine
`
`Specification gives VM designers a great deal of leeway in deciding how their
`
`implementations will manage memory, including deciding whether or not to even use
`
`garbage collection at all. Thus, it is possible that some JVMs (such as a bare-bones smart
`
`card JVM) may require that programs executed in each session "fit" in the available
`
`memory.
`
`Of course, you can always run out of memory, even on a virtual memory system. The
`
`JVM Spec does not state how much memory will be available to a JVM. It just states that
`
`whenever a JVM does run out of memory, it should throw an OutOfMemoryError.
`
`2
`
`2
`
`

`

`ghijkilmnoikpÿW
`
` ÿÿÿq22ÿW 
 
`q
`rÿs  ÿt
` ÿu
`ÿ


`ÿ
`ÿu
`ÿwxyqÿW2yWÿz
`    ÿ
`ÿ
 ÿ ÿ


`ÿ ÿ ÿ ÿ
`ÿ  
 ÿ

`ÿ 
 ÿ
`
`
`
`ÿ 
` ÿ
`ÿ ÿ
ÿ ÿÿ   ÿ
` 
` ÿ ÿ   ÿ
` 
` ÿ 
ÿ
` 
` ÿ
`
ÿÿ   ÿ
` ÿ
`ÿ ÿ ÿ
`ÿÿ 
` ÿÿ ÿ 
` 
ÿÿ ÿ
` ÿÿÿ    ÿ ÿ ÿÿ ÿ
` ÿ 
` !"#!$%ÿ'())%'*+(,ÿ!)$("+*-.ÿ+/ÿ,(*ÿ0%1+,%0
`2
` ÿ
`ÿ
`ÿ
`3ÿ
ÿ
ÿ ÿ ÿ 



`ÿ
ÿ455ÿ789:ÿ;<=;ÿ>:?ÿ@=AB=@?
`CD55?C;EDFÿG>:;ÿ>:?ÿ;<?ÿHHHÿ=5@DAE;<GIÿ ÿ 
 ÿ
`ÿ ÿ ÿ ÿ
`ÿ 
 ÿ
`
`   ÿ
` 

`ÿ
ÿ
` Jÿ
ÿ
ÿ
  

`ÿK  ÿ
` 

`ÿ
`
ÿ

`
` ÿ ÿ
ÿ
ÿ ÿ 
` ÿÿ
 ÿ
`ÿJ ÿ
ÿ
  

`ÿ  ÿÿ
`
` 


`3ÿ
ÿ
ÿ


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#ÿ $/ÿc)"ÿ$ÿ#)ÿ$")ÿ$!)ÿ"ÿ)Kÿ#)
`
` !.!$ÿ+"L#ÿ()ÿ$()ÿ#ÿ )"ÿ$"'ÿ!)ÿ%)/
`Yÿ,$*$ÿ !.!$ÿ#$#ÿ$M)ÿ)ÿ%ÿ&ÿ$"ÿ(-)&#ÿd")ÿ#$#ÿ )"ÿ$ÿ%)ÿ"ÿ#ÿ&"#!&#!
`$"ÿ&)ÿ#ÿ"ÿ#ÿ%"$?)!eÿ$'ÿ+!Mÿ%")ÿ"ÿ)ÿ,OPÿ ))"#$#"/ÿf"ÿ&
`
` ))"#$#"Kÿ%"$?$#"ÿ+ÿ&&!ÿ%#)"ÿ)".ÿ#ÿM)) ÿ$ÿ%%&)"#ÿ"()!ÿ%
`%)ÿ$")ÿ$*$$()ÿ$#ÿ$ÿ#)/ÿg#ÿ#)ÿ$)ÿ !.!$ÿ$'ÿ%$ÿ"ÿ$ÿ%%)!)"#ÿ,OP
`
`Teams Through Change
`
`The central rule of thumb concerning finalizers is this:
`
`Don 't design your Java programs such that correctness depends upon "timely"
`
`finalization.
`
`In other words, don't write programs that will break if certain objects aren't finalized by
`
`certain points in the life of the program's execution. If you write such a program, it may
`
`work on some implementations of the JVM but fail on others.
`
`SponsoredPost Sponsored by Salesforce
`ClOs Should Adopt a Digital Mindset to Lead
`
`Don't rely on finalizers to release non-memory resources
`
`An example of an object that breaks this rule is one that opens a file in its constructor
`
`and closes the file in its finalize() method. Although this design seems neat, tidy, and
`
`symmetrical, it potentially creates an insidious bug. A Java program generally will have
`
`only a finite number of file handles at its disposal. When all those handles are in use, the
`
`program won't be able to open any more files.
`
`A Java program that makes use of such an object (one that opens a file in its constructor
`
`and closes it in its finalizer) may work fine on some JVM implementations. On such
`
`implementations, finalization would occur often enough to keep a sufficient number of
`
`file handles available at all times. But the sar‘ge program may fail on a different JVM
`
`4
`
`

`

`  ÿ ÿ
` 
`
ÿ  
ÿ ÿ
ÿ ÿ
ÿÿ
ÿÿ
`ÿXY73Z[ÿ\3]3Z\ÿ^
`ÿ
ÿÿ ÿ   ÿÿ 
 ÿÿÿ   ÿ
ÿÿÿÿÿ
`
`ÿ 

 ÿÿ 
ÿ ÿÿÿ 
`

` ÿ 

ÿÿÿ ÿ  ÿ  
`
`
`  !ÿ ÿ
ÿ 
`"#$%&ÿ()*+,)-%&ÿ&.,%/ÿ0(ÿ#$.12
`3ÿ
ÿ 
`  ÿ 
ÿ
ÿÿ   ÿÿ  
`
ÿ
ÿ
 ÿ ÿ
 !ÿ

ÿ
`4
`
ÿ
ÿ  ÿ ÿ
ÿ ÿÿ 
` ÿ  ÿ ÿ ÿÿ5  ÿÿ ÿ
`ÿÿ ÿÿ 6
 ÿ ÿÿ  ÿ
 ÿÿ
`
`
ÿ ÿ
 ÿ
 ÿ7ÿ
`ÿ  ÿ  ÿÿ
`
`
 ÿÿ  ÿ ÿÿÿÿ

` ÿ 
`ÿ ÿÿ

` ÿ
 ÿ
ÿÿÿÿ ÿÿ 

 ÿ 
ÿ ÿÿ
 
`8ÿ  ÿ ÿÿÿ ÿ

ÿÿ
`   ÿÿ 9
`
ÿ
ÿ ÿ  ÿ 
ÿ

`:;<=>;?@ABÿ
 ÿ
 ÿ ÿÿ
` 
 ÿ 
ÿ ÿ
ÿÿ4
`

`C ÿ
` 
`
 ÿÿÿ4
`
 ÿ
ÿ ÿ  ÿ ÿÿÿÿ
ÿ

`
ÿÿ
ÿ 
`
ÿ

ÿÿ4
`
ÿ ÿ
ÿ7ÿÿ ÿ
ÿ ÿ

ÿ
`

` ÿ ÿ ÿ
`
`   ÿÿ
`
ÿ ÿÿ
ÿ
ÿ

ÿ ÿ 
`

ÿ
ÿ   ÿÿ4
`
 ÿ

ÿÿ ÿ ÿ
ÿ ÿ
` 
 ÿ
ÿ 
`ÿÿ ÿÿ
 ÿ 
ÿ  ÿ
`
` ÿ 9
`
ÿ 
ÿÿ
ÿ ÿ
ÿ
ÿ ÿ
`
ÿ 
`
 ÿ 
ÿDÿ 
ÿ
ÿ ÿ
` 
`
ÿ ÿ
ÿ4
`
ÿ
ÿ 
`ÿÿ 9
`
ÿ 
ÿÿ
ÿ ÿ ÿ
ÿ 
`
ÿ4
ÿ3ÿ
` ÿ
 ÿ 
ÿ
`
ÿÿ
ÿEF<G;<=>;?@EHI<JK;LABÿ
 ÿÿ
`  ÿMF<L;N@ÿÿOPHL@Nÿ 
`LEF@ÿ ÿ
ÿ  ÿ
ÿ7ÿÿÿ
`
 ÿ 9
`
ÿ  ÿ  ÿ

`Q0ÿR$+#ÿ+&%ÿ()*+,)-%&/ÿS00Tÿ(0&U
`  
 ÿ ÿ ÿ ÿ
ÿÿ4
ÿ ÿ ÿ
ÿ
`EF<G;<=>;?@EHI<JK;LABÿ  ÿÿÿ
`Dÿÿÿÿ ÿ
ÿ
ÿ ÿ

ÿÿ 
ÿ ÿ
` ÿ ÿÿ  ÿV  
`
ÿ ÿ  ÿ

ÿ
ÿÿ
ÿ
`   ÿÿ  ÿ
ÿ
`  ÿÿ ÿ
ÿÿ 
`  ÿ
ÿ ÿ  
`
`5
`
`

`

`function that calls malloc ( )), that object's finalizer could invoke a native method that
`
`frees that memory (calls free( )). In this situation, you would be using the finalizer to
`
`free up memory allocated on behalf of an object -- memory that will not be
`
`automatically reclaimed by the garbage collector.
`
`Another, more common, use of finalizers is to provide a fallback mechanism for releasing
`
`non-memory finite resources such as file handles or sockets. As mentioned previously,
`
`you shouldn't rely on finalizers for releasing finite non-memory resources. Instead, you
`
`should provide a method that will release the resource. But you may also wish to include
`
`a finalizer that checks to make sure the resource has already been released, and if it
`
`hasn't, that goes ahead and releases it. Such a finalizer guards against (and hopefully will
`
`not encourage) sloppy use of your class. If a client programmer forgets to invoke the
`
`method you provided to release the resource, the finalizer will release the resource if the
`
`object is ever garbage collected. The finalize() method of the LogFileManager class,
`
`shown later in this article, is an example of this kind of finalizer.
`
`Avoid finalizer abuse
`
`rev, application for a finalizer is to free memory allocated by
`One reasonable, [tnloEuDghAr
`native methods. If an object invokes a native method that allocates memory (perhaps a C
`
` ÿ  
`ÿ
 
ÿ
`ÿ   ÿÿÿ  ÿÿ ÿÿÿ  ÿ
`ÿNO/PQÿ./,/P.ÿR
`  ÿ
ÿÿ ÿ ÿ ÿÿ  ÿ
ÿ
 ÿ  ÿÿ
ÿÿ
`   ÿ
 ÿ ÿ !"#$%
`ÿ
 ÿ &ÿ  ÿ ÿ ÿÿ  ÿ
ÿ

`ÿ
 ÿÿ ÿ'())#$%ÿ ÿ
ÿ  
`ÿ ÿ* ÿÿ  ÿ
ÿ  ÿ 
`ÿ ÿÿ  ÿ ÿ
 ÿÿ ÿ ÿ++ÿÿ
 ÿ* ÿ  ÿ
`   ÿ ÿÿ
ÿÿ  
`, 

`ÿÿ
`ÿ ÿÿ  ÿÿ ÿÿÿ ÿ
 ÿÿ  
`  +ÿ  ÿ ÿ 
ÿÿ ÿ
  ÿÿ ÿ,ÿ  ÿ  
`
` ÿ
  & ÿ ÿ ÿ  ÿÿ  ÿ  ÿ  +ÿ ÿ  
`ÿ
`
 ÿÿÿ
ÿ
 ÿ* ÿ ÿ
ÿ ÿ- ÿ ÿÿ ÿ*
ÿ ÿ  
`ÿ  ÿ
 ÿ
ÿ ÿÿ ÿ
ÿ ÿ
ÿ ÿ ÿ 
`ÿ ÿÿ
`
 &
`ÿ
 ÿÿ
ÿ ÿ ÿ ÿ. 
ÿÿ  ÿ ÿ  ÿ ÿ
 ÿ*
`  ÿ  %ÿ ÿ ÿÿ ÿ ÿÿÿ  ÿÿ ÿ ÿ ÿ

`
ÿ ÿÿ ÿ ÿ
ÿ 
`ÿ
ÿ  ÿ* ÿ ÿ
ÿ ÿÿ

`89:;<ÿ>;?@A;BCDÿ@EFGC
` ÿÿÿÿ  ÿ/
ÿ'01 02)#$ÿ
ÿÿ
ÿ3!450 )614)(ÿ 
`
`
* ÿ  ÿ ÿ
ÿ  
`ÿÿ ÿ7 ÿÿ
ÿ ÿÿ  
`/
ÿ7  ÿÿ    ÿ ÿÿ   ÿ   ÿÿHIJÿ 
`ÿ   ÿ  ÿÿHÿÿK
 ÿ    ÿ ÿ 
`ÿÿ*ÿÿ
ÿ ÿ ÿ
ÿÿ ÿ ÿ

`ÿ ÿÿ ÿ 
`   ÿ  ÿ ÿHÿ ÿ  ÿ ÿ ÿ  ÿ++ÿ ÿ ÿ
ÿÿ ÿ ÿ
` ÿ
ÿ ÿ ÿ ÿ*ÿÿ  ÿ ÿ 
ÿ
ÿÿÿ ÿ
` ÿ ÿ
ÿ ÿ ÿ  ÿ ÿÿ  ÿ  ÿ  ÿ
 ÿÿ  ÿL L%ÿ,
 

` 
ÿ*ÿÿÿ   ÿ ÿ7ÿ ÿ ÿÿ ÿ ÿ 
`ÿ
ÿ ÿ
`
ÿÿ ÿ ÿ
ÿ    ÿ ÿ ÿ
ÿ*ÿ ÿ 
`ÿ   ÿ ÿ
`  ÿ   ÿ  ÿ 
`/
ÿ ÿ    ÿÿ
ÿ ÿÿ
 ÿ ÿÿ
 ÿ ÿ   ÿ ÿ
` ÿ ÿ ÿ+ +   ÿÿ
 ÿ & ÿ ÿ   ÿ,ÿ
`ÿÿ
ÿ
ÿÿ  ÿÿ ÿ7ÿ ÿ
ÿÿ&ÿ *ÿ* ÿ ÿÿ
 %
`
` ÿ ÿ ÿ  ÿ
`ÿ ÿ
 ÿ ÿ   ÿ* ÿÿÿ ÿ 
`
`The existence of finalization produces some interesting complications for JVMs and
`
`some interesting possibilities for Java programmers. What finalization grants to
`
`programmers is power over the life and death of objects. In short, it is possible and
`
`completely legal in Java to resurrect objects in finalizers -- to bring them back to life by
`
`making them referenced again. (One way a finalizer could accomplish this is by adding a
`
`reference to the object being finalized to a static linked list that is still "live.") Although
`
`such power may be tempting to exercise because it makes you feel important, the rule of
`
`thumb is to resist the temptation to use this power. In general, resurrecting objects in
`
`finalizers constitutes finalizer abuse.
`
`The main justification for this rule is that any program that uses resurrection can be
`
`redesigned into an easier-to-understand program that doesn't use resurrection. A formal
`
`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?5>82I9>12BB3ÿG9119ACÿ?7A
`P2DYK@<9>ZBBÿ;>ÿK[\P
`89E9B769AD
`
`unpredictable aislbriEeDcstT/fiTrEiglization. As such, a design that uses resurrection will be
`
`difficult to figure out by the next maintenance programmer who happens along -- who
`
`may not fully understand the idiosyncrasies of garbage collection in Java.
`
`If you feel you simply must bring an object back to life, consider cloning a new copy of
`
`the object instead of resurrecting the same old object. The reasoning behind this piece
`
`of advice is that garbage collectors in the JVM invoke the finalize() method of an
`
`object only once. If that object is resurrected and becomes available for garbage
`
`collection a second time, the object's finalize() method will not be invoked again.
`
`Page 1 of 2
`
`)
`
`. Stay up to date with InfoWorld's newsletters for software developers, analysts,
`
`database programmers, and data scientists.
`
`. Get expert insights from our member-only Insider articles.
`
`YOU MAY ALSO LIKE
`
`Tim O'Reilly: the golden age of Why MongoDB is
`
`When to use Task.WaitAll vs.
`
`the programmer is over
`
`'fundamentally better' for
`
`Task.WhenAll in .N ET
`
`developers
`
`7
`
`

`

`UNITED STATES V
`
`How |T priorities are shifting
`
`Don't migrate your problems to The shifting market for
`
`during the COVlD-19 crisis
`
`the cloud
`
`PostgreSQL
`
`7 tools transforming
`JavaScript development
`
`3 good ways to validate
`APls
`
`How Al can enhance
`customer experience
`
`ÿ<=>?@AÿC?D?@CÿE
`  ÿ

`ÿ ÿ 
` ÿ
`
`ÿ  ÿ

` ÿ 
` ÿÿ  
` ÿ

`ÿ  
`! 
`"#$
`
`
`ÿ 
`ÿ
`ÿÿ 
` ÿ)ÿ
ÿ
`

`
`%ÿ  ÿ 
  
`(ÿ ÿ
 ÿ ÿ'


`
` 
`ÿ
`*
`
`
`
`)!
`&
'
" ÿ
`'
` 
`
`)
+ ÿ,

` -ÿ.
` ÿ

`ÿ ÿ/
 
`0
`ÿ1
`
`
` ÿ ÿ ÿ
`ÿ   
`  
`"!8"9:ÿ$81"
` "
`
 2ÿ
 ÿ
`

` ÿ
`

` ÿ ÿ
` 3ÿ
`
 3ÿ


` 3ÿ
`ÿ
4ÿ"
`
`ÿ 
`ÿ 
` 
` ÿ ÿ
`'
` 5ÿ
`
`
`ÿ6ÿ
`'
` 
`ÿ
`'

 
`ÿ 
`ÿ
`ÿ
ÿ
ÿ)!ÿ
` ÿ  4ÿ 7 ÿ
ÿ 4ÿ"
`
`ÿ 4
`
`dtSearch® instantly searches terabytes of files, emails, databases, web data. See site for
`
`Amazon Braket: Get started with quantum
`
`When Kubernetes is not the solution
`
`computing
`
`SPONSORED LINKS
`
`hundreds of reviews; enterprise 8 developer evaluations
`
`Truly modern web app and API security thinking. It's a thing. See how.
`
`8
`
`8
`
`

`

`DDoS extortion attacks are real. Don't Negotiate. Mitigate with NETSCOUT. Learn more.
`
`Reliable remote networks. Set up remote work quickly. Get secure remote network access.
`
`Reimagine remote work to catch the next wave in digital transformation. Read e-book
`
`Cisco SecureX Simplify with the broadest, most integrated security platform
`UNITED STATES v
`
`ÿ !" #ÿ$%&'(ÿ)*+ÿ*+ ÿ,"-. */ÿ$*ÿ0* 1"-* .ÿ !"*(ÿ%&-*'"$
`ÿKLMNÿOMPMNOÿQ
`22ÿ 3*"*0ÿ-**-4ÿ-" ÿ" -&5ÿ206*ÿ7 1*-* 5ÿ8*1-* ÿ)*+ÿ79:;<:5ÿ= -"0ÿ$" 5
`> &-,& ÿ" $* ÿ0 *)"45ÿ *ÿ!%ÿ" $* ÿ)"4ÿ?!4&(5ÿ@ *ÿ !" ÿ" $* ÿ0 *)"4ÿ- 5
`> $-10 ÿ" $* ÿ)"4ÿ*ÿ-*+ÿ*+ ÿ0 3*ÿ)-A ÿ0ÿ.1*-&ÿ*"-0'"$-*05ÿ> -.ÿ B,4
`@ **01ÿ-ÿ@"%ÿ0ÿC-ÿ(, "ÿD(1 0 ÿ)*+ÿ*+ ÿEÿ0*"&
`C".1 ÿ*+ ÿ&!.ÿ(!ÿ+-A ÿ*ÿ*+ ÿ 3% " 0 ÿ(!ÿ)-0*5ÿ@ *ÿ*-"* ./ÿ*.-(
`F" %-"01ÿG!"ÿ: +0&1(ÿH!0.-*0ÿ'"ÿ-ÿ7 )ÿD(,".ÿI"&.
`  ÿ
`ÿ
ÿÿ  ÿ
`
`Getting a Grip on Basic Cyber Hygiene with the CIS Controls
`
`Bridge the clouds you have to the experience you want. Get started, today
`
`Preparing Your Technology Foundation for a New Hybrid World
`
`
`$106
`{Wyn-:L-Amm Copyright © 2021 IDG Communications, Inc.
`
`9
`
`

This document is available on Docket Alarm but you must sign up to view it.


Or .

Accessing this document will incur an additional charge of $.

After purchase, you can access this document again without charge.

Accept $ Charge
throbber

Still Working On It

This document is taking longer than usual to download. This can happen if we need to contact the court directly to obtain the document and their servers are running slowly.

Give it another minute or two to complete, and then try the refresh button.

throbber

A few More Minutes ... Still Working

It can take up to 5 minutes for us to download a document if the court servers are running slowly.

Thank you for your continued patience.

This document could not be displayed.

We could not find this document within its docket. Please go back to the docket page and check the link. If that does not work, go back to the docket and refresh it to pull the newest information.

Your account does not support viewing this document.

You need a Paid Account to view this document. Click here to change your account type.

Your account does not support viewing this document.

Set your membership status to view this document.

With a Docket Alarm membership, you'll get a whole lot more, including:

  • Up-to-date information for this case.
  • Email alerts whenever there is an update.
  • Full text search for other cases.
  • Get email alerts whenever a new case matches your search.

Become a Member

One Moment Please

The filing “” is large (MB) and is being downloaded.

Please refresh this page in a few minutes to see if the filing has been downloaded. The filing will also be emailed to you when the download completes.

Your document is on its way!

If you do not receive the document in five minutes, contact support at support@docketalarm.com.

Sealed Document

We are unable to display this document, it may be under a court ordered seal.

If you have proper credentials to access the file, you may proceed directly to the court's system using your government issued username and password.


Access Government Site

We are redirecting you
to a mobile optimized page.





Document Unreadable or Corrupt

Refresh this Document
Go to the Docket

We are unable to display this document.

Refresh this Document
Go to the Docket