Java Reference
In-Depth Information
of pop-up hints that
IDEA
provides as we progress through the topic; for now,
know that you can toggle them on or off by double-clicking the pop-up hints area
of the status bar.
Toggling between insert and overwrite mode
The current text entry mode is indicated in the status bar by either the word
Insert
or the word
Overwrite
, and your cursor changes to a block cursor when
you switch modes (unless you're using a block cursor by default, in which case it
switches to the line cursor). You can toggle between the two modes by pressing the
Insert key on your keyboard.
By default, the editor operates in insert mode. That is, as you type, characters
are added into the document, pushing existing characters off to the right.
IDEA
also supports editing in overwrite mode, in which case your typing destroys any
existing characters by typing over the top of them.
Monitoring memory usage
The memory indicator shows you how much memory
IDEA
has to work with. The
indicator displays the amount of memory currently in use and the amount avail-
able. You can remove the memory indicator by disabling the
Show memory indi-
cator
option located in the
Appearance
setting under
Window Options
.
This amount changes over time as you open more files, perform searches, and
so forth. The amount may be misleading, however, because it indicates the
current
heap size and not the
maximum
possible heap size. Every Java program runs
under a given memory configuration that specifies the minimum and maximum
size of the Java heap. The
VM
keeps bumping up the heap size as needed until it
reaches the maximum allotment. When the
VM
runs short of memory, it runs the
garbage collector to free up space in the heap. If an application's maximum heap
size is too small, it will spend lots of time in the garbage collector—this is bad
news, because the program must stop everything while the garbage collector is
running. If
IDEA
is running slowly and is frequently using all its memory, you may
need to increase the size of the heap.
Once the
VM
claims some memory by growing the size of the heap, the mem-
ory is never returned to the system—even if it's subsequently freed by garbage
collection. Therefore, it's important to pick a maximum heap size that is large
enough to accommodate everything you need to do, without taking so much
memory away from the operating system that it becomes unusable. Refer to chap-
ter 12 for information about customizing your memory settings.