130 likes | 282 Views
JavaOne 2002 http://servlet.java.sun.com/javaone/. Greg White, March 24-29th 2002. Content. J2SE Interoperability with XML based protocols Real-time java Performance tuning References to Best picks. J2 Standard Edition (J2SE). The basic (default) Java package, freely distributed
E N D
JavaOne 2002http://servlet.java.sun.com/javaone/ Greg White, March 24-29th 2002
Content • J2SE • Interoperability with XML based protocols • Real-time java • Performance tuning • References to Best picks Greg White, ESD
J2 Standard Edition (J2SE) • The basic (default) Java package, freely distributed • Now in v1.4. Stability, scalability, compatibility • Includes V1.3 of Java2D ~ 100% faster than v1.2, X support 4-5 times faster • Includes CORBA • “New I/O”. Much faster IO, file/screen/socket, abstract data type buffer manipulation • 1 VM : many threads on many cpus. • 64bit clean, now in Spark, soon on itanium. • Logging API included. Simple assertion. • Exception chaining • Core XML support bundled, include JAX*, SAX, DOM • Connectivity: IPv6 addressing, new URI class. • Security: JSSE Secure Socket Extension (ssl, HTTPS), kerberos Greg White, ESD
J2SE continued • JFC/Swing gives full drag and drop. • Deployment: Web Start now in SDK • v1.4.1 (autumn) • >1 VM Sharing loaded libraries, so SHR, GBL • v1.5 (late next year) • Templates! • Compiler conversion of primitive types Greg White, ESD
Interoperability XML based Protocols (“Web Services”) • WSDL, defines a “service” in XML, CORBA like • SOAP, MIME, http bindings. W3C Spec and Example • UDDI (Universal Description Discovery Integration) • A standard for Name and Directory services • JAX-RPC, can be used to implement the service according to the WSDL with SOAP implementation • JAXP, Parses XML, both SAX and DOM. It’s a XML implementation independent layer and API for XML document processing. • JAXR, Access to XML based registries, like name or directory services. • JAXM, An API for XML based messaging. • JAXB, Maps XML tags and types to Java language types Greg White, ESD
Why Might Web Services be Important to Us down the line? • If we package application data in XML • E.g. in SDDS like model App XML format data X-bean BPM data Web JAX-RPC Servlet Greg White, ESD
Why Might Web Services be Important to Us down the line? • If we package application data in XML • JAXP for parsing, JAXM for messaging, JAXB for mapping XML data to objects Dir/Svc BPM App XML format data UDDI JAXM X-bean AIDA EPICS SOAP/WSDL Web History Servlet Greg White, ESD
Real Time Java • RTSJ - Real Time Specification for Java • Predictable execution > fast execution: “Real Time != Real fast” • No syntax extensions, but more APIs and Extensible Classes • Scheduler class • Timer class • Asynch event handling • Asynch Transfer of Control (ACT) like setjmp/longjmp • High resolution time (~1ns) • Objects not managed by regular Garbage Collection • “Immortal Memory Area” • Physical memory control • Ref: http://www.rtsj.org Greg White, ESD
RT Java con’t • Tools for smaller class • Jopt, JAX, DashO, javac -g:none • Implementations • VxWorks implementation: Insignia Solutions impl of Personal Java (PersonalJ) http://java.sun.com/products/personaljava/ • jStamp: HW aJile chip and PS. 1x2in, DIP40 pins http://jstamp.systronix.com/ Talks: J2ME in Lindholm Tech Keynote RT Java in Deeply Embedded Sys: TS-3190 Greg White, ESD
Performance Tuning • Do’s • Architect to call-by-reference (ie use reference types) • Avoid JNI if Java enabled database driver • Threading • Size thread pool appropriately • In v1.4 1 JVM/cpu can manage >1 thread (because Java/JVM threads != kernel threads). • Use thread monitoring tool (Hpview). • Kill -QUIT on JVM will give you a thread dump • Hotspot: • Choose carefully between “-client” and “-server” • Use -verbose:gc to see what its doing. Resize generations (“eden” and “old”) wisely • -Xincgo for better pauses • -? For better throughput • Try bigger heap (-Xmx), or bigger new generation Greg White, ESD
Programming for Performance • Array sizing: Size array in declaration (otherwise it does dbgetc-like remalloc). • Don’t use exception based flow-control (!) • Use New I/O buffer classes for array manipulation • Minimize object creation - do it at init. Pool objects. Design methods to modify existing objects, not create new ones. • Avoid synchronization • Avoid serializing • Understand how lib methods work. • Use external caching support (eg HTTP Cache-control tags) • Use long instead of java.util.Date • Use arguments and locals in preference to member variables • Use char array instead of StringBuffer • Use db connection pooling Greg White, ESD
Best Picks • Graham Hamilton, Tech Keynote • http://servlet.java.sun.com/javaone/sf2002/conf/keynotes/index.en.jsp • Optimizing for the Java(TM) Servlet API and Java DataBase Connectivity(TM) (JDBCTM) Technology TS-1355. Speakers: Tim Kientzle • Performance optimization tools, what to look for, practical actions for improvement • A Programmer Survivor's Guide for Java(TM) Technology, Using Mature Programming Practices, Patterns and Principles TS-2758 • Performance Tuning for 'Big Iron' TS-2008 • The Java(TM) 2 Platform, Standard Edition (J2SETM) 1.4 Release and Beyond TS-1756, Speakers: Graham Hamilton • Best Practices for CORBA TS-1663 Speakers: Ken Cavanaugh,Hemanth Puttaswamy • New I/O APIs for the Java(TM) Platform TS-3477, Speakers: Mark Reinhold • Performance Technologies for the Java(TM) Platform, for Deeply Embedded and Real-Time Systems TS-3190 • An Introduction to the Java(TM) Native Interface (JNI) TS-2253: Speakers: John Chamberlain • The Java(TM) 2 Platform, Enterprise Edition (J2EETM) Tutorial TS-1715 Speakers: Stephanie Bodoff,Dale Green,Kathy Walrath Greg White, ESD