C Pascal Main Storage Memory Process: 58. What Is Heap Memory?

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 4

58. What is heap memory?

In certain programming languages including C and Pascal , a heap is an area of pre-reserved


computer main storage ( memory ) that a program process can use to store data in some variable
amount that won't be known until the program is running. For example, a program may accept
different amounts of input from one or more users for processing and then do the processing on
all the input data at once. Having a certain amount of heap storage already obtained from the
operating system makes it easier for the process to manage storage and is generally faster than
asking the operating system for storage every time it's needed. The process manages its allocated
heap by requesting a "chunk" of the heap (called a heap block ) when needed, returning the
blocks when no longer needed, and doing occasional "garbage collecting," which makes blocks
available that are no longer being used and also reorganizes the available space in the heap so
that it isn't being wasted in small unused pieces.

59 . Example of a bottleneck and how do you found it and how it was resolved?
60. How do you Identify a Memory Leak?

Memory leak cannot be measured in a single test run, it can measured only doing multiple
test runs and Memory leak can happen MAINLY during (when i say mainly, dont mean it to
be ONLY ) STRESS testing rather than Performance testing example, suppose that during
the first iteration of load tests, the process shows a marked increase in memory
consumption, indicating a possible memory leak. In the subsequent iterations, additional
memory can be consumed, these can be captured to study the memory allocation pattern
for the application.

61. What could cause a memory Leak?

a memory leak is a type of resource leak that occurs when a computer program incorrectly
manages memory allocations[1] in such a way that memory which is no longer needed is not
released. In object-oriented programming, a memory leak may happen when an object is stored in
memory but cannot be accessed by the running code.[2] A memory leak has symptoms similar to a
number of other problems and generally can only be diagnosed by a programmer with access to the
program's source code.

Because they can exhaust available system memory as an application runs, memory leaks are often
the cause of or a contributing factor to software aging.

62. how to take a heap dump ?

63 . different memory types in a heap?

64. what is garbage collection?


garbage collection (GC) is a form of automatic memory management. The garbage collector, or
just collector, attempts to reclaim garbage, or memory occupied by objects that are no longer in use
by the program Garbage collection is often portrayed as the opposite of manual memory
management, which requires the programmer to specify which objects to deallocate and return to
the memory system. However, many systems use a combination of approaches, including other
techniques such as stack allocation and region inference. Like other memory management
techniques, garbage collection may take a significant proportion of total processing time in a
program and, as a result, can have significant influence on performance. With good
implementations, enough memory, and depending on application, garbage collection can be faster
than manual memory management, while the opposite can also be true and has often been the case
in the past with sub-optimal GC algorithms.

65. types of GC ?

Java has four types of garbage collectors,

1. Serial Garbage Collector

2. Parallel Garbage Collector

3. CMS Garbage Collector

4. G1 Garbage Collector

Each of these four types has its own advantages and disadvantages. Most importantly, we the
programmers can choose the type of garbage collector to be used by the JVM. We can choose
them by passing the choice as JVM argument. Each of these types differ largely and can
provide completely different application performance. It is critical to understand each of these
types of garbage collectors and use it rightly based on the application.

66. What according to you is the best configuration for heap?

67. what type of GC is the best?


g-1 it can be used for large heap memory areas

68. how do you diagnose what is causing a memory leak?

69. what do you look for in AWR projects?

70. what is deadlock?

71. what is a full table scan?

You might also like