diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/asyncprofiler/AsyncProfilerDataSender.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/asyncprofiler/AsyncProfilerDataSender.java index 46a25c4cc..be5af4c36 100644 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/asyncprofiler/AsyncProfilerDataSender.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/asyncprofiler/AsyncProfilerDataSender.java @@ -100,6 +100,7 @@ public class AsyncProfilerDataSender implements BootService, GRPCChannelListener GRPC_UPSTREAM_TIMEOUT, TimeUnit.SECONDS ).collect(new ClientResponseObserver() { ClientCallStreamObserver requestStream; + final byte[] buf = new byte[DATA_CHUNK_SIZE]; @Override public void beforeStart(ClientCallStreamObserver requestStream) { @@ -111,7 +112,6 @@ public class AsyncProfilerDataSender implements BootService, GRPCChannelListener if (AsyncProfilingStatus.TERMINATED_BY_OVERSIZE.equals(value.getType())) { LOGGER.warn("JFR is too large to be received by the oap server"); } else { - byte[] buf = new byte[DATA_CHUNK_SIZE]; try { int bytesRead; while ((bytesRead = fileInputStream.read(buf)) != -1) { diff --git a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java index fe2b7448e..373ff40a0 100755 --- a/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java +++ b/apm-sniffer/apm-agent-core/src/main/java/org/apache/skywalking/apm/agent/core/conf/Config.java @@ -262,9 +262,9 @@ public class Config { /** * Max execution time(second) for the Async Profiler. The task will be stopped even if a longer time is specified. - * default 10min. + * default 20min. */ - public static int MAX_DURATION = 600; + public static int MAX_DURATION = 1200; /** * Path for the JFR outputs from the Async Profiler. diff --git a/apm-sniffer/config/agent.config b/apm-sniffer/config/agent.config index 0ceb65862..695e47349 100755 --- a/apm-sniffer/config/agent.config +++ b/apm-sniffer/config/agent.config @@ -166,8 +166,8 @@ profile.dump_max_stack_depth=${SW_AGENT_PROFILE_DUMP_MAX_STACK_DEPTH:500} profile.snapshot_transport_buffer_size=${SW_AGENT_PROFILE_SNAPSHOT_TRANSPORT_BUFFER_SIZE:4500} # If true, async profiler will be enabled when user creates a new async profiler task. If false, it will be disabled. The default value is true. asyncprofiler.active=${SW_AGENT_ASYNC_PROFILER_ACTIVE:true} -# Max execution time(second) for the Async Profiler. The task will be stopped even if a longer time is specified. default 10min. -asyncprofiler.max_duration=${SW_AGENT_ASYNC_PROFILER_MAX_DURATION:600} +# Max execution time(second) for the Async Profiler. The task will be stopped even if a longer time is specified. default 20min. +asyncprofiler.max_duration=${SW_AGENT_ASYNC_PROFILER_MAX_DURATION:1200} # Path for the JFR outputs from the Async Profiler. If the parameter is not empty, the file will be created in the specified directory, otherwise the Files.createTemp method will be used to create the file. asyncprofiler.output_path=${SW_AGENT_ASYNC_PROFILER_OUTPUT_PATH:} # If true, the agent collects and reports metrics to the backend.