ApplicationInsights-Java icon indicating copy to clipboard operation
ApplicationInsights-Java copied to clipboard

ApplicationInsights-agent-3.4.12 generate otel-agentXXX/agent.jar files in windows/Temp which consumes all memory

Open fred-sudo opened this issue 11 months ago • 2 comments

Expected behavior

temp generated agent.jar file in windows/Temp folder should be removed automatically because the programmer did not write or program to create the jar file.

Actual behavior

The file agent.jar in windows/Temp/otel-agentXXXXXXXXXX/agent.jar is not getting deleted. It creates an out-of-memory issue on the server. Admin is not supposed to write batch process to write windows based another batch script to delete these files

To Reproduce

any spring boot-based batch process using application-insights lib 3.4.12 will reproduce the same issue

System information

Please provide the following information:

  • SDK Version: java 1.8-351
  • OS type and version: windows 10
  • Application Server type and version (if applicable):
  • Using spring-boot? yes
  • Additional relevant libraries (with version, if applicable):

Logs

logs are just file but in windows/Temp/otel-agentXXXXXXXX/agent.jar files are creating pollution. there is a well-known issue of Windows OS java can not delete jar file bugs.openjdk.org/browse/JDK-8219681. but using RandomAccessFile class of standard jdk lib it must be possible to delete the file. RunTime.getRuntime.addShutdownHook() or deleteonExit() definitely should work. Or ApplicationInsights-agent lib has to manage this without creating an agent.jar file

Screenshots

Not possible to bring screenshots here

fred-sudo avatar Jul 10 '23 15:07 fred-sudo