首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到20条相似文献,搜索用时 303 毫秒
1.
Java异常处理   总被引:4,自引:0,他引:4  
强大的异常处理机制是Java的一大优势,正确地使用Java异常处理能够使程序更健壮,但在实际应用中对Java异常处理存在很多不合理的地方.对Java异常处理机制和异常类层次作了简单介绍,并对异常处理中应该注意的事项作了一个总结.  相似文献   

2.
Java的异常处理机制增强了程序的容错能力,提高了程序的可读性和可维护性。对Java的异常处理技术展开了深入的探讨,并结合实例说明了Java异常处理技术在编程中的应用。  相似文献   

3.
Java是面向对象的程序语言,其异常处理机制是Java的一大特色。本文讨论了Java的异常处理机制,并指出异常处理机制中常见错误模式及注意事项,以便更好的利用Java解决实际问题。  相似文献   

4.
异常处理机制是Java程序设计中的一个重要方面,正确使用异常处理的策略和方法,能够确保Java程序结构的清晰性、易读性和健壮性。分析了Java异常的体系结构,阐述了异常分类与处理机制,提出了异常处理的一般原则和一种异常处理框架,并结合实际应用对该框架进行了详细描述。  相似文献   

5.
异常处理是程序设计中必须重点考虑的问题。在深入剖析Java语言的异常处理机制基础上,对Java异常处理提出了指导原则,从而可以提高程序的安全性和健壮性。  相似文献   

6.
Java异常处理机制研究   总被引:2,自引:0,他引:2  
异常处理机制是程序设计语言的主要特征,它为开发稳定的软件系统提供了有力的支持.文章对Java语言的异常处理机制以及异常类的层次进行了详细介绍,提出了Java异常处理策略.  相似文献   

7.
异常处理机制是Java语言的一大特色。从异常处理的机制、异常处理的方法、异常处理的原则等方面介绍Java语言的异常处理技术,分析了抛出异常和捕获异常的实际应用及注意事项,以便更好地利用异常处理机制解决实际问题。  相似文献   

8.
异常处理机制是Java语言的一大特色。从异常处理的机制、异常处理的方法、异常处理的原则等方面介绍Java语言的异常处理技术,分析了抛出异常和捕获异常的实际应用及注意事项,以便更好地利用异常处理机制解决实际问题。  相似文献   

9.
Java的异常处理机制是其一大特色。该文在介绍Java语言的异常处理技术的基础上,提出了异常处理的设计原则,从而为Java的程序设计实现提供技术上的借鉴。  相似文献   

10.
Java语言的异常处理设计原则   总被引:4,自引:0,他引:4  
异常处理是Java语言的重要语言机制,正确地处理异常对程序的可靠性、健壮性是十分重要的。回顾了异常处理技术的概念和思想,对异常处理提出了一套实用的设计原则,并针对Java语言的具体环境,分类介绍了各种异常的常用处理方式。  相似文献   

11.
We provide a rigorous framework for language and platform independent design and analysis of exception handling mechanisms in modern programming languages and their implementations. To illustrate the practicality of the method we develop it for the exception handling mechanism of Java and show that its implementation on the Java Virtual Machine (JVM) Is correct. For this purpose we define precise abstract models for exception handling in Java and in the JVM and define a compilation scheme of Java to JVM code which allows us to prove that, in corresponding runs, Java and the JVM throw the same exceptions and with equivalent effect. Thus, the compilation scheme can, with reasonable confidence, be used as a standard reference for Java exception handling compilation  相似文献   

12.
Java virtual machine (JVM) crashes are often due to an invalid memory reference to the JVM heap. Before the bug that caused the invalid reference can be fixed, its location must be identified. It can be in either the JVM implementation or the native library written in C invoked from Java applications. To help system engineers identify the location, we implemented a feature using page protection that prevents threads executing native methods from referring to the JVM heap. This feature protects the JVM heap during native method execution; if the heap is referred to invalidly, it interrupts the execution by generating a page-fault exception. It then reports the location where the exception was generated. The runtime overhead for using this feature depends on the frequency of native method calls because the protection is switched on each time a native method is called. We evaluated the runtime overhead by running the SPECjvm98, SPECjbb2000, VolanoMark, and JFCMark benchmark suites on a PC with two Intel Xeon® 1.6 GHz processors. The performance loss was less than 2% for the benchmark items that do not call native methods so frequently (104 times per second) and 5%–20% for the benchmark items that do (104–105 times per second). The worst performance loss was 54%, which was recorded for a benchmark item that calls native methods 2.0×106 times per second.  相似文献   

13.
Hardware bytecode translation is a technique to improve the performance of the Java virtual machine (JVM), especially on the portable devices for which the overhead of dynamic compilation is significant. However, since the translation is done on a single bytecode basis, a naive implementation of the JVM generates frequent memory accesses for local variables which can be not only a performance bottleneck but also an obstacle for instruction folding. A solution to this problem is to add a small register file to the data path of the microprocessor which is dedicated for storing local variables. However, the effectiveness of such a local variable register file depends on the size and the local variable access behavior of the applications.In this paper, we analyze the local variable access behavior of various Java applications. In particular, we will investigate the fraction of local variable accesses that are covered by the register file of a varying size, which determines the chip area overhead and the operation speed. We also evaluate the effectiveness of the sliding register window for parameter passing in context of JVM and on-the-fly optimization of local variable to register file mapping.With two types of exceptions, a 16-entry register file achieves coverages of up to 98%. The first type of exception is represented by the SAXON XSLT processor for which the effect of cold miss is significant. Adding the sliding window feature to the register file for parameter passing turns 6.2-13.3% of total accesses from miss to hit to the register file for the SAXON with XSLTMark. The second type of exception is represented by the FFT, which accesses more than 16 local variables for most of method invocations. In this case, on-the-fly profiling is effective. The hit ratio of a 16-entry register file for the FFT is increased from 44% to 83% by an array of 8-bit counters.  相似文献   

14.
Mnemonics is a Scala library for generating method bodies in JVM bytecode at run time. Mnemonics supports a large subset of the JVM instructions, for which the static typing of the generator guarantees the well-formedness of the generated bytecode.  相似文献   

15.
This paper presents architecture independent characterization of embedded Java workloads based on the industry standard GrinderBench benchmark which includes different classes of real world embedded Java applications. This work is based on a custom built embedded Java virtual machine (JVM) simulator specifically designed for embedded JVM modeling and embodies domain specific details such as thread scheduling, algorithms used for native CLDC APIs and runtime data structures optimized for use in embedded systems. The results presented include dynamic execution characteristics, dynamic bytecode instruction mix, application and API workload distribution, object allocation statistics, instruction-set coverage, memory usage statistics and method code and stack frame characteristics.  相似文献   

16.
One of the most promising approaches to Java acceleration in embedded systems is a bytecode-to-C ahead-of-time compiler (AOTC). It improves the performance of a Java virtual machine (JVM) by translating bytecode into C code, which is then compiled into machine code via an existing C compiler. One important design issue in AOTC is efficient exception handling. Since the excepting point and the exception handler may locate in different methods on a call stack, control transfer between them should be streamlined, while an exception would be an “exceptional” event, so it should not slow down normal execution paths. Previous AOTCs often employed a technique called stack cutting based on a setjmp()/longjmp() pair, which we found is involved with too much performance overheads. Also, when the AOTC and the interpreter are employed concurrently (e.g., some methods are AOTCed while other methods are interpreted), the performance of normal execution paths is affected more seriously. This paper proposes a simpler solution based on an exception check after each method call, merged with garbage collection check for reducing its overhead. Our evaluation results on SPECjvm98 on Sun's CVM indicate that our technique can improve the performance of stack cutting by more than 25%. A similar performance benefit can be noted on a hybrid execution environment of both the AOTC and the interpreter.  相似文献   

17.
基于垃圾收集的Java程序性能改善方法*   总被引:1,自引:0,他引:1  
JVM中堆的默认配置有时并不适用于大型程序,这会使系统在垃圾收集上耗费过多的时间,进而导致程序性能下降。简要分析了HotSpot JVM垃圾收集机制,然后结合已有研究,以一个网管程序为例,提出了通过调整垃圾收集提高程序运行效能的方法。  相似文献   

18.
This paper describes JaRec, a portable record/replay system for Java. It correctly replays multi‐threaded, data‐race free Java applications, by recording the order of synchronization operations, and by executing them in the same order during replay. The record/replay infrastructure is developed in Java, and does not require a modification of the Java Virtual Machine (JVM) if it provides the JVM Profiler Interface (JVMPI). If the JVM does not support JVMPI, which is used for intercepting the loaded classes, only a minor modification to the JVM is required in order to run the system. On ystems with limited memory resources, JaRec can be executed in a distributed fashion. This also makes it suitable to aid debugging of multi‐threaded applications on embedded systems. Copyright © 2004 John Wiley & Sons, Ltd.  相似文献   

19.
This paper describes the design, implementation, and experimental evaluation of a modular and extensible Java? Virtual Machine (JVM) infrastructure, called Jupiter. The infrastructure is intended to serve as a vehicle for our research on scalable JVM architectures for a cluster of PC workstations, with support for shared memory in software. Jupiter is constructed, using a building block architecture, out of many modules with small, simple interfaces. This flexible structure, similar to UNIX® shells that build complex command pipelines out of discrete programs, allows the rapid prototyping of our research ideas by confining changes in JVM design to a small number of modules. In spite of this flexibility, Jupiter delivers good performance. Experimental evaluation of the current implementation of Jupiter using the SPECjvm98 and the EPCC Java Grande single‐threaded and multithreaded benchmarks reflects competitive performance. Jupiter is on average about 2.5 times faster than Kaffe and about 2 times slower than the Sun Microsystems JDK (interpreter versions only). By providing a flexible JVM infrastructure that delivers competitive performance, we believe we have developed a framework that supports further research into JVM scalability. Copyright © 2003 John Wiley & Sons, Ltd.  相似文献   

20.
简要介绍了Java的多线程调度机制和POSIX线程同步机制,并通过对kaffe虚拟机同步机制和加锁机制的深入分析,研究了Java虚拟机内部的同步和加锁机制及其实现。提出一种Java虚拟机锁方案:逻辑锁和物理锁的"双层锁"结构,并在此基础上,提出了利用底层硬件指令来提高加锁速度的"快速锁"加锁方案。最后在数字电视嵌入式平台上进行了虚拟机多线程性能的相关测试。  相似文献   

设为首页 | 免责声明 | 关于勤云 | 加入收藏

Copyright©北京勤云科技发展有限公司  京ICP备09084417号