首页 | 本学科首页   官方微博 | 高级检索  
相似文献
 共查询到18条相似文献,搜索用时 390 毫秒
1.
将结合量值和内存的模型,对堆与栈结构与特点做出比较分析,希望对于高级编程语言(如Java,C,C++等)的学习与内存模型的理解提供一定的帮助。  相似文献   

2.
堆与栈都是Java中用来在RAM中存放数据的地方,介绍了堆与栈存储数据的特点,对Java中的各种数据类型在堆与栈中的存储方式进行了分析。  相似文献   

3.
胡雯 《软件导刊》2010,(7):29-30
Java把内存划分为堆和栈。介绍了堆和栈的区别,并以String类对象为例说明它们在内存分配中的不同,及对程序编写的影响。  相似文献   

4.
1 Java内存划分情况 计算机中程序运行都是在内存中进行的,Java程序是交给JVM自动管理,内存区域是指JVM的内存,大致可划分为四个部分:(1) Java栈Java栈也称作虚拟机栈,是Java方法执行的内存模型.Java栈中存放的是一个个的栈帧,每个栈帧对应一个被调用的方法,在栈帧中包括局部变量表、操作数栈、指向当前方法所属类的运行时常量池的引用、方法返回地址和一些额外的附加信息.(2)本地方法栈本地方法栈以帧的形式存放本地方法的调用状态,包括方法调用的参数、局部变量、中间结果等.方法都是以方法帧的形式存放在方法区.(3) Java堆Java堆是一个运行时的数据区,用来存储数据的单元,堆中存放通过new关键字新建的对象和数组.在JVM中只有一个堆,可以在运行时动态地分配内存大小,存取速度较慢.在堆中声明的对象不能直接访问,必须通过在栈中声明的引用来调用.引用变量存储的是指向堆中的数组或对象的地址,即指针.(4)方法区方法区是被线程共享的区域.在方法区中,存储了每个类的信息,包括类的名称、方法信息、字段信息、静态变量、常量以及编译器编译后的代码等.  相似文献   

5.
为了减少Java虚拟机垃圾收集器的开销,对Java栈帧进行改造使其支持对象的存储,在此基础上提出一种基于栈式内存分配的垃圾收集算法。算法首先在编译阶段通过对Java源代码进行分析确定栈式分配对象,并用扩展指令标识这些对象,程序运行时它们直接被分配到Java栈上,这些对象在程序离开其作用域时立即被释放,其它对象则分配到堆上,由垃圾收集器进行回收。实验结果表明,与传统基于堆式的垃圾收集算法相比,新算法内存分配和即时回收性能优,占用内存空间少。垃圾回收更及时,减轻了垃圾收集器的负担,提高了运行速度。  相似文献   

6.
为了减少Java虚拟机垃圾收集器的开销,对Java栈帧进行改造使其支持对象的存储,在此基础上提出一种基于栈式内存分配的垃圾收集算法。算法首先在编译阶段通过对Java源代码进行分析确定栈式分配对象,并用扩展指令标识这些对象,程序运行时它们直接被分配到Java栈上,这些对象在程序离开其作用域时立即被释放,其它对象则分配到堆上,由垃圾收集器进行回收。实验结果表明,与传统基于堆式的垃圾收集算法相比,新算法内存分配和即时回收性能优,占用内存空间少,垃圾回收更及时,减轻了垃圾收集器的负担,提高了运行速度。  相似文献   

7.
详细阐述了C++编译器的内存分配形式,给出了堆、栈、文字常量区、寄存器区、静态区、程序代码区的分配策略,分析了内存分配中易产生的问题及导致程序运行出错的原因和解决办法,从而避免程序异常和内存错误,保证程序的健壮性和正确性。  相似文献   

8.
Java程序内存行为研究是对Java平台存储管理系统进行能耗优化的首要工作.测试了大量典型Java应用程序的内存行为数据,通过对数据的分析发现Java程序的内存分配模式和内存使用轨迹存在明显的规律.最终得出了Java程序内存行为具有阶段性、周期性和平稳性等结论,这些规律对于Java虚拟机优化垃圾收集和Java程序的能耗优化有着重要的指导意义.  相似文献   

9.
Java程序内存泄漏综述*   总被引:1,自引:0,他引:1  
从与C/C++内存泄漏对比的角度分析了Java内存泄漏问题,详细介绍了Java内存泄漏的相关研究和工具,探讨了当前研究和工具中存在的不足并分析了其原因,总结了内存泄漏相关领域研究的发展趋势。  相似文献   

10.
非增量式Java虚拟机(JVM)垃圾回收算法的内存开销较大。为此,提出一种基于栈式分配策略的JVM增量式垃圾收集算法。对Java栈帧进行改造使其支持存储对象,改进增量式收集器中堆空间的划分、引用跟踪方式,以减少垃圾收集带来的不确定性暂停。实验结果表明,该算法能有效减少暂停的频率和时长,提高运行速度。  相似文献   

11.
Java just-in-time (JIT) compilers improve the performance of a Java virtual machine (JVM) by translating Java bytecode into native machine code on demand. One important problem in Java JIT compilation is how to map stack entries and local variables to registers efficiently and quickly, since register-based computations are much faster than memory-based ones, while JIT compilation overhead is part of the whole running time. This paper introduces LaTTe, an open-source Java JIT compiler that performs fast generation of efficiently register-mapped RISC code. LaTTe first maps "all" local variables and stack entries into pseudoregisters, followed by real register allocation which also coalesces copies corresponding to pushes and pops between local variables and stack entries aggressively. Our experimental results indicate that LaTTe's sophisticated register mapping and allocation really pay off, achieving twice the performance of a naive JIT compiler that maps all local variables and stack entries to memory. It is also shown that LaTTe makes a reasonable trade-off between quality and speed of register mapping and allocation for the bytecode. We expect these results will also be beneficial to parallel and distributed Java computing: 1) by enhancing single-thread Java performance; and 2) by significantly reducing the number of memory accesses which the rest of the system must properly order to maintain coherence and keep threads synchronized  相似文献   

12.
在嵌入式Java芯片中使用即时编译技术   总被引:1,自引:0,他引:1  
Java虚拟机具有面向堆栈与面向对象的特点,不利于硬件有效支持字节码的直接执行,传统JIT也不适应嵌入式系统的应用环境,介绍了在自行设计的嵌入式Java芯片中使用JIT的技术途径,通过对Java虚拟机堆栈和复杂指令的支持,密切配合JIT软件,较好地解决了Java芯片设计中的问题。测试结果表明,相对于目前前界最好的picoJava-Ⅱ内核而言内核而言,JC401的编译后代码性能提高了1.2至1.9倍,在硬件复杂度、执行速度、内存开销等方面都有较大程度的改善,适合于嵌入式应用。  相似文献   

13.
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.  相似文献   

14.
Java card is a new system for programming smart cards,which is based on the Java language and Virtual Machine,Java card programs(applets)run in Java Card Runtime Environment (JCRE)including the java Card Virtual Machine(JCVM),the framework,the assoicated native methods and the API(Application Programming Interface),JCVM is implemented as two separate pieces: off-card VM(Virtual Machine)and on-card VM.The stack model and heap memory structure used by on-car VM and exception handling are introduced.Because there are limited resources wihin smart card environment,and garbage collection is not supported in JCVM,the preferred way to exception handling does not directly involve the use of throw,although the throw keyowrd is supported.Security is the most important feature of smart card.The Java Card applet security feature is also discussed.  相似文献   

15.
Many Java applications instantiate objects within the Java heap that are persistent but seldom if ever referenced by the application. Examples include strings, such as error messages, and collections of value objects that are preloaded for fast access. This paper describes a stack‐based framework for detecting these ‘cold’ objects at runtime, with a view to marshaling and sequestering them in designated regions of the heap where they may be preferentially paged out to a backing store, thereby freeing physical memory pages for occupation by more active objects. Furthermore, we evaluate the correctness and efficiency of stack‐based approach with an access barrier. The experimental results from a series of SPECjvm2008 benchmarks are presented. Copyright © 2016 John Wiley & Sons, Ltd.  相似文献   

16.
Java处理器技术   总被引:1,自引:0,他引:1  
本文介绍了几种 Java处理器技术的结构和特点 ,包括 Java虚拟机、采用堆栈结构的 Java处理器、Java协处理器、采用 VL IW技术的 Java并行处理器等 .最后 ,简述了 Java处理器技术的最近发展概况  相似文献   

17.
Java存储模型是Java语言和Java虚拟机研究中的核心关键部分,目前Java语言规范中的存储模型不能保证Java技术所必需的语义特性,而且不利于Java虚拟机的性能优化.提出了一种新的Java存储模型,该模型取消了规范中Java存储模型中对存储密致性的要求,保证了Location一致性;同时根据Java语义的要求,对Java语言中不同类型的变量详细规定了多线程存储操作的行为规则.该模型不仅能保证Java程序的正确性,同时能有效提高Java程序的运行效率.最后通过仿真实验验证了该存储模型的关键特性.  相似文献   

18.
程序运行过程中一些不再被使用的对象未及时释放会引发内存泄漏问题,泄漏对象经过长期累积会降低系统性能,甚至导致系统崩溃。针对Java程序中的内存泄漏问题,提出了一种内存泄漏对象检测与度量方法。通过动态跟踪源程序的执行过程,周期性记录堆栈信息,并分析堆中可疑的泄漏对象。定义内存泄漏度计算方法,度量不同对象对程序泄漏的影响程度,从而确定产生泄漏的对象。最后选取两个开源程序进行验证,并与两种现有方法进行对比,结果表明该方法的泄漏检测率较高。  相似文献   

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

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