Deployment Architecture

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

udaymadupathi
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

niketn
Legend

@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

niketn
Legend

@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!!!"
0 Karma

udaymadupathi
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:

Max_Heap_size **
Free_Heap_size 10717437440

0 Karma

udaymadupathi
New Member

fixed it thanks.

0 Karma

udaymadupathi
New Member

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

0 Karma

udaymadupathi
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

udaymadupathi
New Member

can any one help me to get query

0 Karma

udaymadupathi
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.__AW_throwFabricInvocationException(WebServiceExternalBindingComponent.java:673)
at oracle.integration.platform.blocks.soap.WebServiceExternalBindingComponent.throwFabricInvocationException(WebServiceExternalBindingComponent.java)
at oracle.integration.platform.blocks.soap.WebServiceExternalBindin

0 Karma
Get Updates on the Splunk Community!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...