Tabnine Logo
MemoryInfoProvider.getHeapMemoryUsage
Code IndexAdd Tabnine to your IDE (free)

How to use
getHeapMemoryUsage
method
in
rocks.inspectit.agent.java.sensor.platform.provider.MemoryInfoProvider

Best Java code snippets using rocks.inspectit.agent.java.sensor.platform.provider.MemoryInfoProvider.getHeapMemoryUsage (Showing top 7 results out of 315)

origin: inspectIT/inspectIT

  protected void mockCollectorWithDefaults() {
    MemoryUsage heapMemoryUsage = Mockito.mock(MemoryUsage.class);
    when(heapMemoryUsage.getUsed()).thenReturn(0L);
    when(heapMemoryUsage.getCommitted()).thenReturn(0L);

    MemoryUsage nonHeapMemoryUsage = Mockito.mock(MemoryUsage.class);
    when(nonHeapMemoryUsage.getUsed()).thenReturn(0L);
    when(nonHeapMemoryUsage.getCommitted()).thenReturn(0L);

    when(this.osBean.getFreePhysicalMemorySize()).thenReturn(0L);
    when(this.osBean.getFreeSwapSpaceSize()).thenReturn(0L);
    when(this.osBean.getCommittedVirtualMemorySize()).thenReturn(0L);
    when(this.memoryBean.getHeapMemoryUsage()).thenReturn(heapMemoryUsage);
    when(this.memoryBean.getNonHeapMemoryUsage()).thenReturn(nonHeapMemoryUsage);
  }
}
origin: inspectIT/inspectIT

@Test
void comittedHeapMemorySizeIsCalculated() {
  this.mockCollectorWithDefaults();
  MemoryUsage heapMemoryUsage = this.memoryBean.getHeapMemoryUsage();
  when(heapMemoryUsage.getCommitted()).thenReturn(10L).thenReturn(9L).thenReturn(11L).thenReturn(10L);
  this.cut.gather();
  this.cut.gather();
  this.cut.gather();
  this.cut.gather();
  MemoryInformationData collector = (MemoryInformationData) this.cut.get();
  assertThat(collector.getMinComittedHeapMemorySize(), is(9L));
  assertThat(collector.getMaxComittedHeapMemorySize(), is(11L));
  assertThat(collector.getTotalComittedHeapMemorySize(), is(40L));
}
origin: inspectIT/inspectIT

@Test
void usedHeapMemorySizeIsCalculated() {
  this.mockCollectorWithDefaults();
  MemoryUsage heapMemoryUsage = this.memoryBean.getHeapMemoryUsage();
  when(heapMemoryUsage.getUsed()).thenReturn(10L).thenReturn(9L).thenReturn(11L).thenReturn(10L);
  this.cut.gather();
  this.cut.gather();
  this.cut.gather();
  this.cut.gather();
  MemoryInformationData collector = (MemoryInformationData) this.cut.get();
  assertThat(collector.getMinUsedHeapMemorySize(), is(9L));
  assertThat(collector.getMaxUsedHeapMemorySize(), is(11L));
  assertThat(collector.getTotalUsedHeapMemorySize(), is(40L));
}
origin: inspectIT/inspectIT

when(heapMemoryUsage.getInit()).thenReturn(16L);
when(heapMemoryUsage.getMax()).thenReturn(17L);
when(this.memoryBean.getHeapMemoryUsage()).thenReturn(heapMemoryUsage);
origin: inspectIT/inspectIT

when(heapMemoryUsageA.getInit()).thenReturn(16L);
when(heapMemoryUsageA.getMax()).thenReturn(17L);
when(this.memoryBean.getHeapMemoryUsage()).thenReturn(heapMemoryUsageA);
when(heapMemoryUsageB.getInit()).thenReturn(1600L);
when(heapMemoryUsageB.getMax()).thenReturn(1700L);
when(this.memoryBean.getHeapMemoryUsage()).thenReturn(heapMemoryUsageB);
origin: inspectIT/inspectIT

this.systemInformationData.setVmSpecName(this.getRuntimeBean().getSpecName());
this.systemInformationData.setInitHeapMemorySize(this.getMemoryBean().getHeapMemoryUsage().getInit());
this.systemInformationData.setMaxHeapMemorySize(this.getMemoryBean().getHeapMemoryUsage().getMax());
origin: inspectIT/inspectIT

long freeSwapSpace = this.getOsBean().getFreeSwapSpaceSize();
long comittedVirtualMemSize = this.getOsBean().getCommittedVirtualMemorySize();
long usedHeapMemorySize = this.getMemoryBean().getHeapMemoryUsage().getUsed();
long comittedHeapMemorySize = this.getMemoryBean().getHeapMemoryUsage().getCommitted();
long usedNonHeapMemorySize = this.getMemoryBean().getNonHeapMemoryUsage().getUsed();
long comittedNonHeapMemorySize = this.getMemoryBean().getNonHeapMemoryUsage().getCommitted();
rocks.inspectit.agent.java.sensor.platform.providerMemoryInfoProvidergetHeapMemoryUsage

Javadoc

Returns the current memory usage of the heap that is used for object allocation. The heap consists of one or more memory pools. The used and committed size of the returned memory usage is the sum of those values of all heap memory pools whereas the init and max size of the returned memory usage represents the setting of the heap memory which may not be the sum of those of all heap memory pools.

The amount of used memory in the returned memory usage is the amount of memory occupied by both live objects and garbage objects that have not been collected, if any.

Popular methods of MemoryInfoProvider

  • getNonHeapMemoryUsage
    Returns the current memory usage of non-heap memory that is used by the Java virtual machine. The no

Popular in Java

  • Making http post requests using okhttp
  • setScale (BigDecimal)
  • onRequestPermissionsResult (Fragment)
  • putExtra (Intent)
  • Selector (java.nio.channels)
    A controller for the selection of SelectableChannel objects. Selectable channels can be registered w
  • Path (java.nio.file)
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • Executor (java.util.concurrent)
    An object that executes submitted Runnable tasks. This interface provides a way of decoupling task s
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Best plugins for Eclipse
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now