Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the local method stack

2025-01-30 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces the relevant knowledge of "what is the local method stack". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!

Local method stack

The Java virtual machine stack manages calls to Java methods, while the local method stack manages calls to local methods.

The local method stack is also thread private.

Allows to be implemented as a fixed or dynamically expandable memory size. (it is the same in terms of memory overflow)

If the thread requests that the stack capacity exceed the maximum allowed by the local method stack, the Java virtual machine will throw a stackoverflowError exception.

If the local method stack can be expanded dynamically and cannot apply for enough memory when trying to extend, or if there is not enough memory to create the corresponding local method stack when creating a new thread, the Java virtual machine will throw an outofMemoryError exception.

Local methods are implemented in C language.

It does this by registering the native method in Native Method Stack and loading the local method library when the Execution Engine is executed.

When a thread calls a local method, it enters a whole new world that is no longer restricted by virtual machines. It has the same permissions as the virtual machine.

Local methods can access the runtime data area inside the virtual machine through the local method interface.

It can even use registers in the local processor directly.

Allocate any amount of memory directly from the heap of local memory.

Not all JVM supports local methods. Because the Java virtual machine specification does not explicitly require the use of local method stack language, specific implementation, data structure and so on. If the JVM product does not intend to support native methods, there is no need to implement the local method stack.

In Hotspot JVM, you directly combine the local method stack and the virtual machine stack into one.

This is the end of what is the local method stack. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report