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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

A Four-Part Event Series: Full Stack Observability For the AI Era

As AI reshapes applications, infrastructure, and the way teams operate, the traditional boundaries of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...