Dear team, I have a file copy application, that run between tomcat server and java client. Its copy file from server end to paste at client end.
At server end code written in Servlet file. Its read file data and file name from file. And storing it into String object and send it to client in response. At server end we are creating file using above data and file name. I have shared code snipped below. -------------------------- Server end ------------------ ---------------------------------- File fromFolderSec = new File("folder path"); File[] sendfile = fromFolderSec.listFiles(); File[] var28 = sendfile; String filesContent = null; File file = sendfile[0]; String currFileName = file.getName(); try { filesName.add(file.getName()); FileInputStream fis = new FileInputStream(file); int arraysize = fis.available(); StringBuffer sb = new StringBuffer(); int i; for(i = 0; i < arraysize; ++i) { sb.append((char)fis.read()); } filesContent.add(sb.toString()); fis.close(); } catch (StringIndexOutOfBoundsException var36) { System.out.println( " Exception occurred while sending file: Exc=" + var36.getMessage()); } ---------------Client end ------------------------- File toFolderSec = new File("Folder path"); try { File ffile = null; File tempFolder = new File(toFolderSec.getPath()); ffile = new File(toFolderSec.getPath() + "//" + currFileName); BufferedWriter bw = new BufferedWriter(new FileWriter(ffile)); String data = filesContent.get(0); bw.write(data); bw.flush(); bw.close(); } catch (Exception var36) { System.out.println( " Exception Exc=" + var36.getMessage()); } ------------------------------------------------------- This code was working fine on HPunix. Recently we have migrated our server to IBM Linux1. After migration application getting stuck while sending file size more than 60mb. Below 60mb its working fine. Some error file has gerated in tomcat/bin folder Out of that sharing one file details below File name -- javacore.20220427.122826.201959.0012.txt 1TISIGINFO Dump Event "systhrow" (00040000) Detail "java/lang/OutOfMemoryError" "Java heap space" received 1CIUSERLIMITS User Limits (in bytes except for NOFILE and NPROC) NULL ------------------------------------------------------------------------ NULL type soft limit hard limit 2CIUSERLIMIT RLIMIT_AS unlimited unlimited 2CIUSERLIMIT RLIMIT_CORE unlimited unlimited 2CIUSERLIMIT RLIMIT_CPU unlimited unlimited 2CIUSERLIMIT RLIMIT_DATA unlimited unlimited 2CIUSERLIMIT RLIMIT_FSIZE unlimited unlimited 2CIUSERLIMIT RLIMIT_LOCKS unlimited unlimited 2CIUSERLIMIT RLIMIT_MEMLOCK 65536 65536 2CIUSERLIMIT RLIMIT_NOFILE 10240 10240 2CIUSERLIMIT RLIMIT_NPROC 4096 180193 2CIUSERLIMIT RLIMIT_RSS unlimited unlimited 2CIUSERLIMIT RLIMIT_STACK 838860800 838860800 2CIUSERLIMIT RLIMIT_MSGQUEUE 819200 819200 2CIUSERLIMIT RLIMIT_NICE 0 0 2CIUSERLIMIT RLIMIT_RTPRIO 0 0 2CIUSERLIMIT RLIMIT_SIGPENDING 55347 55347 0SECTION NATIVEMEMINFO subcomponent dump routine NULL ================================= 0MEMUSER 1MEMUSER JRE: 1,085,352,584 bytes / 20226 allocations 1MEMUSER | 2MEMUSER +--VM: 798,286,440 bytes / 16812 allocations 2MEMUSER | | 3MEMUSER | +--Classes: 30,652,464 bytes / 889 allocations 2MEMUSER | | 3MEMUSER | +--Memory Manager (GC): 549,215,240 bytes / 783 allocations 3MEMUSER | | | 4MEMUSER | | +--Java Heap: 536,932,352 bytes / 1 allocation 3MEMUSER | | | 4MEMUSER | | +--Other: 12,282,888 bytes / 782 allocations 2MEMUSER | | 3MEMUSER | +--Threads: 16,317,048 bytes / 257 allocations 3MEMUSER | | | 4MEMUSER | | +--Java Stack: 398,744 bytes / 35 allocations 3MEMUSER | | | 4MEMUSER | | +--Native Stack: 15,597,568 bytes / 36 allocations 3MEMUSER | | | 4MEMUSER | | +--Other: 320,736 bytes / 186 allocations 2MEMUSER | | 3MEMUSER | +--Trace: 730,496 bytes / 2948 allocations 2MEMUSER | | 3MEMUSER | +--JVMTI: 17,776 bytes / 13 allocations 2MEMUSER | | 3MEMUSER | +--JNI: 1,073,544 bytes / 11232 allocations 2MEMUSER | | 3MEMUSER | +--Port Library: 199,144,728 bytes / 89 allocations 3MEMUSER | | | 4MEMUSER | | +--Unused <32bit allocation regions: 199,130,808 bytes / 1 allocation 3MEMUSER | | | 4MEMUSER | | +--Other: 13,920 bytes / 88 allocations 2MEMUSER | | 3MEMUSER | +--Other: 1,135,144 bytes / 601 allocations 1MEMUSER | 2MEMUSER +--JIT: 283,987,376 bytes / 964 allocations 2MEMUSER | | 3MEMUSER | +--JIT Code Cache: 268,435,456 bytes / 1 allocation 2MEMUSER | | 3MEMUSER | +--JIT Data Cache: 4,194,432 bytes / 2 allocations 2MEMUSER | | 3MEMUSER | +--Other: 11,357,488 bytes / 961 allocations 1MEMUSER | 2MEMUSER +--Class Libraries: 3,078,768 bytes / 2450 allocations 2MEMUSER | | 3MEMUSER | +--VM Class Libraries: 3,078,768 bytes / 2450 allocations 3MEMUSER | | | 4MEMUSER | | +--sun.misc.Unsafe: 1,775,312 bytes / 2107 allocations 4MEMUSER | | | | 5MEMUSER | | | +--Direct Byte Buffers: 1,367,440 bytes / 2103 allocations 4MEMUSER | | | | 5MEMUSER | | | +--Other: 407,872 bytes / 4 allocations 3MEMUSER | | | 4MEMUSER | | +--Other: 1,303,456 bytes / 343 allocations NULL NULL ------------------------------------------------------------------------ 0SECTION MEMINFO subcomponent dump routine NULL ================================= NULL 1STHEAPTYPE Object Memory NULL id start end size space/region 1STHEAPSPACE 0x000003FF3808C340 -- -- -- Generational 1STHEAPREGION 0x000003FF3808CD70 0x000000002C3E0000 0x000000004BEA0000 0x000000001FAC0000 Generational/Tenured Region 1STHEAPREGION 0x000003FF3808C8C0 0x000000004BEA0000 0x000000004BFB0000 0x0000000000110000 Generational/Nursery Region 1STHEAPREGION 0x000003FF3808C410 0x000000004BFB0000 0x000000004C3E0000 0x0000000000430000 Generational/Nursery Region NULL 1STHEAPTOTAL Total memory: 536870912 (0x0000000020000000) 1STHEAPINUSE Total memory in use: 437283800 (0x000000001A106BD8) 1STHEAPFREE Total memory free: 99587112 (0x0000000005EF9428) NULL 1STSEGTYPE Internal Memory NULL segment start alloc end type size 1STSEGMENT 0x000003FF18016048 0x000003FF18016860 0x000003FF180280C0 0x000003FF18116860 0x00800040 0x0000000000100000 1STSEGMENT 0x000003FF38069430 0x000003FF1C015F70 0x000003FF1C115F60 0x000003FF1C115F70 0x00800040 0x0000000000100000 1STSEGMENT 0x000003FF38069048 0x000003FEF4506E40 0x000003FEF4606E10 0x000003FEF4606E40 0x00800040 0x0000000000100000 1STSEGMENT 0x000003FF38069368 0x000003FEF4406DF0 0x000003FEF4506DF0 0x000003FEF4506DF0 0x00800040 0x0000000000100000 1STSEGMENT 0x000003FF380691D8 0x000003FEF4306DA0 0x000003FEF4406D70 0x000003FEF4406DA0 0x00800040 0x0000000000100000 1STSEGMENT 0x000003FF38069110 0x000003FEF4206D50 0x000003FEF4306D20 0x000003FEF4306D50 0x00800040 0x0000000000100000 1STSEGMENT 0x000003FF38068F80 0x000003FEF4106D00 0x000003FEF4206CE0 0x000003FEF4206D00 0x00800040 0x0000000000100000 1STSEGMENT 0x000003FF38068DF0 0x000003FEF4006CB0 0x000003FEF4106CB0 0x000003FEF4106CB0 0x00800040 0x0000000000100000 1STSEGMENT 0x000003FF38068EB8 0x000003FF2037F030 0x000003FF2047F030 0x000003FF2047F030 0x00800040 0x0000000000100000 1STSEGMENT 0x000003FF38068D28 0x000003FF3C7FD030 0x000003FF3C8FD020 0x000003FF3C8FD030 0x00800040 0x0000000000100000 Thanks & Regards Deepak Kumar CCIL - IT 022-61546230 CIN of CCIL- U65990MH2001PLC131804 "Disclaimer and confidentiality clause - This message and any attachments relating to official business of CCIL OR ANY OF IT'S SUBSIDIARIES is proprietary to CCIL and intended for the original addressee only. The message may contain information that is confidential and subject to legal privilege. Any views expressed in this message are those of the individual sender. If you have received this message in error, please notify the original sender immediately and destroy the message and copies thereof and any attachments contained in it . If you are not the intended recipient of this message, you are hereby notified that you must not disseminate, copy, use, distribute, or take any action in connection therewith. CCIL cannot ensure that the integrity of this communication has been maintained nor that it is free of errors, viruses, interception and/or interference. CCIL is not liable whatsoever for loss or damage resulting from the opening of this message and/or attachments and/or the use of the information contained in this message and/or attachments."