⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 javalang.doc15.html

📁 java语言规范
💻 HTML
📖 第 1 页 / 共 2 页
字号:
objects, measured in bytes, is returned. The value returned by this method may 
vary over time, depending on the host environment.
<p><a name="25792"></a>
Note that the amount of memory required to hold an object of any given type may be implementation-dependent. <p>
<a name="6856"></a>
<p><font size=+1><strong>20.16.8   </strong> <code>public long <code><b>freeMemory</b></code>()</code></font>
<p>
<a name="6867"></a>
An approximation to the total amount of memory currently available for future 
created objects, measured in bytes, is returned. This value is always less than the 
current value returned by the <code>totalMemory</code> method. Calling the <code>gc</code> method may 
increase the value returned by <code>freeMemory</code>.
<p><a name="14090"></a>
<p><font size=+1><strong>20.16.9   </strong> <code>public void <code><b>gc</b></code>()</code></font>
<p>
<a name="6884"></a>
Calling this method suggests that the Java Virtual Machine expend effort toward 
recycling discarded objects in order to make the memory they currently occupy 
available for quick reuse. When control returns from the method call, the Java 
Virtual &#32;Machine has made a best effort to recycle all discarded objects. (The name 
<code>gc</code> stands for "garbage collector.")
<p><a name="7407"></a>
The Java runtime system will perform this recycling process automatically as needed, in a separate thread, if the <code>gc</code> method is not invoked explicitly.<p>
<a name="7411"></a>
See also the method <code>gc</code> <a href="javalang.doc17.html#14143">(&#167;20.18.12)</a> of class <code>System</code>, which is the conventional and convenient means of invoking this method.<p>
<a name="7413"></a>
<p><font size=+1><strong>20.16.10   </strong> <code>public void <code><b>runFinalization</b></code>()</code></font>
<p>
<a name="6892"></a>
Calling this method suggests that the Java Virtual Machine expend effort toward 
running the <code>finalize</code> methods of objects that have been found to be discarded 
but whose <code>finalize</code> methods have not yet been run. When control returns from 
the method call, the Java Virtual Machine has made a best effort to complete all 
outstanding finalizations.
<p><a name="6897"></a>
The Java runtime system will perform the finalization process automatically as needed, in a separate thread, if the <code>runFinalization</code> method is not invoked explicitly.<p>
<a name="7420"></a>
See also the method <code>runFinalization</code> <a href="javalang.doc17.html#14144">(&#167;20.18.13)</a> of class <code>System</code>, which is the conventional and convenient means of invoking this method.<p>
<a name="25806"></a>
<p><font size=+1><strong>20.16.11   </strong> <code>public void <code><b>traceInstructions</b></code>(boolean on)</code></font>
<p>
<a name="25807"></a>
Calling this method with argument <code>true</code> suggests that the Java Virtual Machine 
emit debugging information for every instruction it executes. The format of this 
information, and the file or other output stream to which it is emitted, depends on 
the host environment.
<p><a name="25819"></a>
Calling this method with argument <code>false</code> suggests that the Java Virtual Machine cease emitting per-instruction debugging information.<p>
<a name="25808"></a>
<p><font size=+1><strong>20.16.12   </strong> <code>public void <code><b>traceMethodCalls</b></code>(boolean on)</code></font>
<p>
<a name="25827"></a>
Calling this method with argument <code>true</code> suggests that the Java Virtual Machine 
emit debugging information for every method call it executes. The format of this 
information, and the file or other output stream to which it is emitted, depends on 
the host environment.
<p><a name="25828"></a>
Calling this method with argument <code>false</code> suggests that the Java Virtual Machine cease emitting per-call debugging information.<p>
<a name="30190"></a>
<p><font size=+1><strong>20.16.13   </strong> <code>public void <code><b>load</b></code>(String filename)</code></font>
<p>
<a name="30194"></a>
First, if there is a security manager, its <code>checkLink</code> method <a href="javalang.doc16.html#14113">(&#167;20.17.17)</a> is called 
with the <code>filename</code> as its argument.
<p><a name="30204"></a>
This is similar to the method <code>loadLibrary</code> <a href="javalang.doc15.html#52468">(&#167;20.16.14)</a>, but accepts a general file name as an argument rather than just a library name, allowing any file of native code to be loaded.<p>
<a name="30199"></a>
See also the method <code>load</code> <a href="javalang.doc17.html#14145">(&#167;20.18.14)</a> of class <code>System</code>, which is the conventional and convenient means of invoking this method.<p>
<a name="52468"></a>
<p><font size=+1><strong>20.16.14   </strong> <code>public void <code><b>loadLibrary</b></code>(String libname)</code></font>
<p>
<a name="52472"></a>
First, if there is a security manager, its <code>checkLink</code> method <a href="javalang.doc16.html#14113">(&#167;20.17.17)</a> is called 
with the <code>libname</code> as its argument.
<p><a name="52473"></a>
A file containing native code is loaded from the local file system from a place where library files are conventionally obtained. The details of this process are implementation-dependent.<p>
<a name="52477"></a>
See also the method <code>loadLibrary</code> <a href="javalang.doc17.html#14146">(&#167;20.18.15)</a> of class <code>System</code>, which is the conventional and convenient means of invoking this method. If <code>native</code> methods are to be used in the implementation of a class, a standard strategy is to put the native code in a library file (call it <code>LibFile</code>) and then to put a static initializer:<p>
<pre><a name="52478"></a>static { System.loadLibrary("LibFile"); }
</pre><a name="52482"></a>
within the class declaration. When the class is loaded and initialized <a href="12.doc.html#44557">(&#167;12.4)</a>, the 
necessary native code implementation for the <code>native</code> methods will then be loaded 
as well.
<p><a name="52515"></a>
<p><font size=+1><strong>20.16.15   </strong> <code>public InputStream<br><code><b>getLocalizedInputStream</b></code>(InputStream in)</code></font>
<p>
<a name="52519"></a>
This method takes an <code>InputStream</code> <a href="javaio.doc1.html#28126">(&#167;22.3)</a> and returns an <code>InputStream</code> equivalent
to the argument in all respects except that it is localized: as data is read from 
the stream, it is automatically converted from the local format to Unicode. If the 
argument is already a localized stream, then it will be returned as the result.
<p><a name="14097"></a>
<p><font size=+1><strong>20.16.16   </strong> <code>public OutputStream<br><code><b>getLocalizedOutputStream</b></code>(OutputStream out)</code></font>
<p>
<a name="46272"></a>
This method takes an <code>OutputStream</code> <a href="javaio.doc13.html#29399">(&#167;22.15)</a> and returns an <code>OutputStream</code> 
equivalent to the argument in all respects except that it is localized: as data is written
to the stream, it is automatically converted from Unicode to the local format. If 
the argument is already a localized stream, then it will be returned as the result.
<p>

<hr>
<!-- This inserts footnotes--><p>
<a href="index.html">Contents</a> | <a href="javalang.doc14.html">Prev</a> | <a href="javalang.doc16.html">Next</a> | <a href="j.index.doc1.html">Index</a>
<p>
<font size=-1>Java Language Specification (HTML generated by Suzette Pelouch on February 24, 1998)<br>
<i><a href="jcopyright.doc.html">Copyright &#169 1996 Sun Microsystems, Inc.</a>
All rights reserved</i>
<br>
Please send any comments or corrections to <a href="mailto:doug.kramer@sun.com">doug.kramer@sun.com</a>
</font>
</body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -