Disable Tracking of Files in a Java Application
Overview of the Issue
This issue occurs in one of the following scenarios:
- An organization runs a Java Application that is impacted by high CPU and Memory when adding the vFunction Agent. The Application creates a large number of Files when instrumented, as seen in the vFunction Analysis' Resources Report
Steps to Resolve the Issue
Take the following steps to resolve this issue:
- SSH or RDP to the VM running the Application where the vFunction Agent is installed
- Modify the native-conf.json either before or after running the installation script
Before the Installation Script
### Using SED
sed -i 's~#tracking_conf~tracking_conf~g' /opt/vfunction/controller-installation/stuff/agent/java/native-conf.json
sed -i 's~"files": true~"files": false~g' /opt/vfunction/controller-installation/stuff/agent/java/native-conf.json
### Linux Sudo / Root Installation
vi /opt/vfunction/controller-installation/stuff/agent/java/native-conf.json
### Linux Sudoless Installation
vi $BASE_DIR/opt/vfunction/controller-installation/stuff/agent/java/native-conf.json
### Windows Installation
$BASE_DIR\\vfunction\\controller-installation\\stuff\\agent\\java\\native-conf.json
{
"#disable_thread_following": true,
"#stack_sampling": false,
"#sampling_ring_size": 256,
"#disable_agct": true,
"#disable_console_logging": true,
### Remove the comment in front of tracking_conf
"tracking_conf": {
"sockets": true,
### Change files from TRUE to FALSE
"files": false,
"sync_objects": true
},
"#static_root_classes": {
"inclusions": [
"Lcom/example/OneClassToInclude;",
"Lcom/example/package1/"
],
"exclusions": [
"Lcom/example/"
]
},
"#force_resolve_on_unload": true
}
After the Installation Script
### Using SED
sed -i 's~#tracking_conf~tracking_conf~g' /etc/sysconfig/vfunction/agent/instances/$INSTANCE_NAME/native-conf.json
sed -i 's~"files": true~"files": false~g' /etc/sysconfig/vfunction/agent/instances/$INSTANCE_NAME/native-conf.json
### Linux Sudo / Root Installation
vi /etc/sysconfig/vfunction/agent/instances/$INSTANCE_NAME/native-conf.json
### Linux Sudoless Installation
vi $BASE_DIR/vfunction/etc/sysconfig/vfunction/agent/instances/$INSTANCE_NAME/native-conf.json
### Windows Installation
$BASE_DIR\\vfunction\\controller-installation\\stuff\\agent\\java\\native-conf.json
{
"#disable_thread_following": true,
"#stack_sampling": false,
"#sampling_ring_size": 256,
"#disable_agct": true,
"#disable_console_logging": true,
### Remove the comment in front of tracking_conf
"tracking_conf": {
"sockets": true,
### Change files from TRUE to FALSE
"files": false,
"sync_objects": true
},
"#static_root_classes": {
"inclusions": [
"Lcom/example/OneClassToInclude;",
"Lcom/example/package1/"
],
"exclusions": [
"Lcom/example/"
]
},
"#force_resolve_on_unload": true
}
- If steps taken before the installation, run the installation script
- Restart the JVM