Java Run-time Exceptions
- Class IllegalStateException
- example
- throw new IllegalStateException();
- use to catch programming development errors.
- exception should never occur unless there is a programming error.
- Class RuntimeException
- not checked
- not extra code
- danger of being a 'lazy programmer'
- can use to side step catch and specify requirements
- Runtime exceptions represent problems that are the result of programming problems
- If the client can reasonable be expected to recover from an exception, make it a checked exception
Garbage Collection in Java VMs
- Big memory
- works with
- JVMs
- HotSpot
- IBM JDK
- JRockit
- what about Dalvik?
- off-heap store
- not subject to Java GC
- Terracotta's tiered cache
- Enterprise Ehcache
- store up to a terabyte in the off-heap
- Dalvik vs Mono
- heap-limits set by OEM with Dalvik
- Dalvik opcodes
- DEX file format
- Dalvik bytecode and Dedexer tool
- overview of Java VM
- Cyanogen allow Dalvik VM settings to be modified
- allocation-free code to avoid GC freeze
- Android, designing from performance
- heap size can be change in 'dx'
- example of changing
- code to see the android GC run
- requesting GC
- System.gc();
- no guarantee it will run
Java Constants and Conditional Compile
- No textual preprocessor
- constants and conditional compilation
- use public static final boolean constant for a regular if statement in regular code
- Have class using the constant interface implement the constant interface
No comments:
Post a Comment