Deployment Architecture

How can I get memory usage for a particular process in Linux?

New Member

How can I get memory usage for a particular process in Linux?

I would like to get JVM memory at a particular time.

0 Karma
1 Solution

SplunkTrust
SplunkTrust

@udaymadupathi, please try the following rex to extract Max Heap Size and Free Heap Size from the sample data provided. Once you have the data

 <yourCurrentSearch>
| rex "Max Heap size:\s(?<max_heap_size>[^\s]+)\s+Free Heap size:\s(?<free_heap_size>[^\s]+)"
| eval used_memory_size=max_heap_size-free_heap_size
| table _time free_heap_size max_heap_size used_memory_size

Following is a run anywhere search based on sample data provided:

| makeresults
| eval _raw="MaxThreadsConstraints: 25

Total dispatcher messages scheduled for processing: 0

Total number of threads processing dispatcher messages: 1

Max Heap size: 4238868480

Free Heap size: 768375192 oracle.fabric.common.FabricInvocationException: oracle.j2ee.ws.client.jaxws.JRFSOAPFaultException: Client received SOAP Fault from server : null
at oracle.integration.platform.blocks.soap.WebServiceExternalBindingComponent.__AW_throwFabricInvocationException(WebServiceExternalBindingComponent.java:673)
at oracle.integration.platform.blocks.soap.WebServiceExternalBindingComponent.throwFabricInvocationException(WebServiceExternalBindingComponent.java)
at oracle.integration.platform.blocks.soap.WebServiceExternalBindin"
| rex "Max Heap size:\s(?<max_heap_size>[^\s]+)\s+Free Heap size:\s(?<free_heap_size>[^\s]+)"
| eval used_memory_size=max_heap_size-free_heap_size
| table _time free_heap_size max_heap_size used_memory_size

You can add timechart command instead of table and calculate % utilization or utilization in some other bits unit as per your needs on top of the rex once it works as expected.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

SplunkTrust
SplunkTrust

@udaymadupathi, please try the following rex to extract Max Heap Size and Free Heap Size from the sample data provided. Once you have the data

 <yourCurrentSearch>
| rex "Max Heap size:\s(?<max_heap_size>[^\s]+)\s+Free Heap size:\s(?<free_heap_size>[^\s]+)"
| eval used_memory_size=max_heap_size-free_heap_size
| table _time free_heap_size max_heap_size used_memory_size

Following is a run anywhere search based on sample data provided:

| makeresults
| eval _raw="MaxThreadsConstraints: 25

Total dispatcher messages scheduled for processing: 0

Total number of threads processing dispatcher messages: 1

Max Heap size: 4238868480

Free Heap size: 768375192 oracle.fabric.common.FabricInvocationException: oracle.j2ee.ws.client.jaxws.JRFSOAPFaultException: Client received SOAP Fault from server : null
at oracle.integration.platform.blocks.soap.WebServiceExternalBindingComponent.__AW_throwFabricInvocationException(WebServiceExternalBindingComponent.java:673)
at oracle.integration.platform.blocks.soap.WebServiceExternalBindingComponent.throwFabricInvocationException(WebServiceExternalBindingComponent.java)
at oracle.integration.platform.blocks.soap.WebServiceExternalBindin"
| rex "Max Heap size:\s(?<max_heap_size>[^\s]+)\s+Free Heap size:\s(?<free_heap_size>[^\s]+)"
| eval used_memory_size=max_heap_size-free_heap_size
| table _time free_heap_size max_heap_size used_memory_size

You can add timechart command instead of table and calculate % utilization or utilization in some other bits unit as per your needs on top of the rex once it works as expected.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

New Member

** MaxThreadsConstraints: 150
** Total dispatcher messages scheduled for processing: 0
** Total number of threads processing dispatcher messages: 0
** Max Heap size: 17132158976
** Free Heap size: 10717437440
]]

i have used it, but ** are still coming up

\s(?[^\s]+)\s+Free Heap size:\s(?[^\s]+)

output:

MaxHeapsize **
FreeHeapsize 10717437440

0 Karma

New Member

fixed it thanks.

0 Karma

New Member

\s(?[^\s]+)\s+Free Heap size:\s(?[^\s]+)

0 Karma

New Member

input

Max Heap size: 16854810624
Free Heap size: 15888020544

am trying below as given

Max Heap size:\s(?[^\s]+)\s*+Free Heap size:\s(?[^\s]+)

output comming is

not found

but other one input

** Max Heap size: 16854810624
** Free Heap size: 15888020544

output coming good by using below

Max Heap size:\s(?[^\s]+)\s*+Free Heap size:\s(?[^\s]+)

0 Karma

New Member

can any one help me to get query

0 Karma

New Member

Here is the data:

Requirement:

would like to get memory usage bu substracting max heap -free heap memory

sample data

MaxThreadsConstraints: 25

Total dispatcher messages scheduled for processing: 0

Total number of threads processing dispatcher messages: 1

Max Heap size: 4238868480

Free Heap size: 768375192 oracle.fabric.common.FabricInvocationException: oracle.j2ee.ws.client.jaxws.JRFSOAPFaultException: Client received SOAP Fault from server : null
at oracle.integration.platform.blocks.soap.WebServiceExternalBindingComponent._AWthrowFabricInvocationException(WebServiceExternalBindingComponent.java:673)
at oracle.integration.platform.blocks.soap.WebServiceExternalBindingComponent.throwFabricInvocationException(WebServiceExternalBindingComponent.java)
at oracle.integration.platform.blocks.soap.WebServiceExternalBindin

0 Karma