VPS,Java,连接超时和内存不足

时间:2015-08-21 16:44:34

标签: java linux talend

我正在从虚拟Linux机器(VPS)运行JAR(例如,Talend作业)。

当我运行jar时,我正面临连接超时异常。

我无法完全解释它,因为如果我在Eclipse中运行JAR(例如在Talend ESB Studio中),它可以正常工作。 jar正在进行一些HTTP GET调用,并使用chrome dev工具测量它们从10s到40s。

在调查抛出此异常的原因时,我在jar目录中找到了一个名为 hs_err_pid6127.log 的文件,其中包含一些关于内存不足的日志,以便Java Runtime Environment继续

这是我的问题:两件事可以以某种方式联系起来吗?如何知道Java Run Time Enviroment的实际内存?这可能是超时的原因吗?如果是的话,如何解决?

JAR异常堆栈跟踪:

Exception in component tREST_2
com.sun.jersey.api.client.ClientHandlerException: java.net.ConnectException: Connection timed out
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:131)
        at com.sun.jersey.api.client.Client.handle(Client.java:616)
        at com.sun.jersey.api.client.WebResource.handle(WebResource.java:559)
        at com.sun.jersey.api.client.WebResource.get(WebResource.java:182)
        at jobtest.forwardjson_0_1.ForwardJSON.tREST_2Process(ForwardJSON.java:1770)
        at jobtest.forwardjson_0_1.ForwardJSON.tFileInputRaw_2Process(ForwardJSON.java:1257)
        at jobtest.forwardjson_0_1.ForwardJSON.tFileInputRaw_1Process(ForwardJSON.java:984)
        at jobtest.forwardjson_0_1.ForwardJSON.tJava_2Process(ForwardJSON.java:713)
        at jobtest.forwardjson_0_1.ForwardJSON.runJobInTOS(ForwardJSON.java:3400)
        at jobtest.forwardjson_0_1.ForwardJSON.main(ForwardJSON.java:3127)
Caused by: java.net.ConnectException: Connection timed out
        at java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:339)
        at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:200)
        at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:182)
        at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)
        at java.net.Socket.connect(Socket.java:579)
        at java.net.Socket.connect(Socket.java:528)
        at sun.net.NetworkClient.doConnect(NetworkClient.java:180)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:432)
        at sun.net.www.http.HttpClient.openServer(HttpClient.java:527)
        at sun.net.www.http.HttpClient.<init>(HttpClient.java:211)
        at sun.net.www.http.HttpClient.New(HttpClient.java:308)
        at sun.net.www.http.HttpClient.New(HttpClient.java:326)
        at sun.net.www.protocol.http.HttpURLConnection.getNewHttpClient(HttpURLConnection.java:997)
        at sun.net.www.protocol.http.HttpURLConnection.plainConnect(HttpURLConnection.java:933)
        at sun.net.www.protocol.http.HttpURLConnection.connect(HttpURLConnection.java:851)
        at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1301)
        at java.net.HttpURLConnection.getResponseCode(HttpURLConnection.java:468)
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler._invoke(URLConnectionClientHandler.java:218)
        at com.sun.jersey.client.urlconnection.URLConnectionClientHandler.handle(URLConnectionClientHandler.java:129)
        ... 9 more

内存错误不足的日志文件内容:

#
# There is insufficient memory for the Java Runtime Environment to continue.
# Native memory allocation (malloc) failed to allocate 179306496 bytes for committing reserved memory.
# Possible reasons:
#   The system is out of physical RAM or swap space
#   In 32 bit mode, the process size limit was hit
# Possible solutions:
#   Reduce memory load on the system
#   Increase physical memory or swap space
#   Check if swap backing store is full
#   Use 64 bit Java on a 64 bit OS
#   Decrease Java heap size (-Xmx/-Xms)
#   Decrease number of Java threads
#   Decrease Java thread stack sizes (-Xss)
#   Set larger code cache with -XX:ReservedCodeCacheSize=
# This output file may be truncated or incomplete.
#
#  Out of Memory Error (os_linux.cpp:2756), pid=6127, tid=122490359273216
#
# JRE version:  (7.0_80-b15) (build )
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.80-b11 mixed mode linux-amd64 compressed oops)
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#

---------------  T H R E A D  ---------------

Current thread (0x00006f677c00a000):  JavaThread "Unknown thread" [_thread_in_vm, id=6128, stack(0x00006f67824a5000,0x00006f67825a6000)]

Stack: [0x00006f67824a5000,0x00006f67825a6000],  sp=0x00006f67825a4270,  free space=1020k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
V  [libjvm.so+0x9a320a]  VMError::report_and_die()+0x2ea
V  [libjvm.so+0x498d3b]  report_vm_out_of_memory(char const*, int, unsigned long, char const*)+0x9b
V  [libjvm.so+0x82191e]  os::Linux::commit_memory_impl(char*, unsigned long, bool)+0xfe
V  [libjvm.so+0x821e69]  os::pd_commit_memory(char*, unsigned long, unsigned long, bool)+0x29
V  [libjvm.so+0x81bb6a]  os::commit_memory(char*, unsigned long, unsigned long, bool)+0x2a
V  [libjvm.so+0x88d623]  PSVirtualSpace::expand_by(unsigned long)+0x53
V  [libjvm.so+0x87c293]  PSOldGen::initialize(ReservedSpace, unsigned long, char const*, int)+0x103
V  [libjvm.so+0x29ace3]  AdjoiningGenerations::AdjoiningGenerations(ReservedSpace, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long)+0x3e3
V  [libjvm.so+0x843215]  ParallelScavengeHeap::initialize()+0x4d5
V  [libjvm.so+0x97509a]  Universe::initialize_heap()+0xca
V  [libjvm.so+0x976269]  universe_init()+0x79
V  [libjvm.so+0x5b2f25]  init_globals()+0x65
V  [libjvm.so+0x95db4d]  Threads::create_vm(JavaVMInitArgs*, bool*)+0x1ed
V  [libjvm.so+0x63b2e4]  JNI_CreateJavaVM+0x74
C  [libjli.so+0x2f8e]  JavaMain+0x9e


---------------  P R O C E S S  ---------------

Java Threads: ( => current thread )

Other Threads:

=>0x00006f677c00a000 (exited) JavaThread "Unknown thread" [_thread_in_vm, id=6128, stack(0x00006f67824a5000,0x00006f67825a6000)]

VM state:not at safepoint (not fully initialized)

VM Mutex/Monitor currently owned by a thread: None

GC Heap History (0 events):
No events

Deoptimization events (0 events):
No events

Internal exceptions (0 events):
No events

Events (0 events):
No events


Dynamic libraries:
00400000-00401000 r-xp 00000000 08:01 661565                             /usr/lib/jvm/java-7-oracle/jre/bin/java
00600000-00601000 rw-p 00000000 08:01 661565                             /usr/lib/jvm/java-7-oracle/jre/bin/java
00601000-023d6000 ---p 00000000 00:00 0
023d6000-023f8000 rw-p 00000000 00:00 0                                  [heap]
6f67330d6000-6f6733254000 rw-p 00000000 00:00 0
6f6733254000-6f673327f000 rw-p 00000000 00:00 0
6f673327f000-6f67332ff000 rw-p 00000000 00:00 0
6f67332ff000-6f6733300000 rw-p 00000000 00:00 0
6f6733300000-6f6733380000 ---p 00000000 00:00 0
6f6733380000-6f6738580000 rw-p 00000000 00:00 0
6f6742f13000-6f6743080000 rw-p 00000000 00:00 0
6f6743080000-6f6763000000 rw-p 00000000 00:00 0
6f6763000000-6f6768580000 rw-p 00000000 00:00 0
6f6768580000-6f6778580000 rw-p 00000000 00:00 0
6f6768580000-6f6778580000 rw-p 00000000 00:00 0
6f6778598000-6f6778808000 rwxp 00000000 00:00 0
6f6778808000-6f677b598000 rw-p 00000000 00:00 0
6f677b598000-6f677b5af000 r-xp 00000000 08:01 661261                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libzip.so
6f677b5af000-6f677b7af000 ---p 00017000 08:01 661261                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libzip.so
6f677b7af000-6f677b7b0000 rw-p 00017000 08:01 661261                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libzip.so
6f677b7b0000-6f677b7bc000 r-xp 00000000 08:01 786478                     /lib/x86_64-linux-gnu/libnss_files-2.21.so
6f677b7bc000-6f677b9bb000 ---p 0000c000 08:01 786478                     /lib/x86_64-linux-gnu/libnss_files-2.21.so
6f677b9bb000-6f677b9bc000 r--p 0000b000 08:01 786478                     /lib/x86_64-linux-gnu/libnss_files-2.21.so
6f677b9bc000-6f677b9bd000 rw-p 0000c000 08:01 786478                     /lib/x86_64-linux-gnu/libnss_files-2.21.so
6f677b9c0000-6f677b9cb000 r-xp 00000000 08:01 786465                     /lib/x86_64-linux-gnu/libnss_nis-2.21.so
6f677b9cb000-6f677bbca000 ---p 0000b000 08:01 786465                     /lib/x86_64-linux-gnu/libnss_nis-2.21.so
6f677bbca000-6f677bbcb000 r--p 0000a000 08:01 786465                     /lib/x86_64-linux-gnu/libnss_nis-2.21.so
6f677bbcb000-6f677bbcc000 rw-p 0000b000 08:01 786465                     /lib/x86_64-linux-gnu/libnss_nis-2.21.so
6f677bbd0000-6f677bbe7000 r-xp 00000000 08:01 786484                     /lib/x86_64-linux-gnu/libnsl-2.21.so
6f677bbe7000-6f677bde6000 ---p 00017000 08:01 786484                     /lib/x86_64-linux-gnu/libnsl-2.21.so
6f677bde6000-6f677bde7000 r--p 00016000 08:01 786484                     /lib/x86_64-linux-gnu/libnsl-2.21.so
6f677bde7000-6f677bde8000 rw-p 00017000 08:01 786484                     /lib/x86_64-linux-gnu/libnsl-2.21.so
6f677bde8000-6f677bdea000 rw-p 00000000 00:00 0
6f677bdf0000-6f677bdf8000 r-xp 00000000 08:01 786480                     /lib/x86_64-linux-gnu/libnss_compat-2.21.so
6f677bdf8000-6f677bff7000 ---p 00008000 08:01 786480                     /lib/x86_64-linux-gnu/libnss_compat-2.21.so
6f677bff7000-6f677bff8000 r--p 00007000 08:01 786480                     /lib/x86_64-linux-gnu/libnss_compat-2.21.so
6f677bff8000-6f677bff9000 rw-p 00008000 08:01 786480                     /lib/x86_64-linux-gnu/libnss_compat-2.21.so
6f677c000000-6f677c026000 rw-p 00000000 00:00 0
6f677c026000-6f6780000000 ---p 00000000 00:00 0
6f67800fc000-6f67801d8000 rw-p 00000000 00:00 0
6f67801d8000-6f6780201000 r-xp 00000000 08:01 661227                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libjava.so
6f6780201000-6f6780401000 ---p 00029000 08:01 661227                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libjava.so
6f6780401000-6f6780403000 rw-p 00029000 08:01 661227                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libjava.so
6f6780408000-6f6780415000 r-xp 00000000 08:01 661254                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libverify.so
6f6780415000-6f6780614000 ---p 0000d000 08:01 661254                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libverify.so
6f6780614000-6f6780616000 rw-p 0000c000 08:01 661254                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/libverify.so
6f6780618000-6f678061f000 r-xp 00000000 08:01 786497                     /lib/x86_64-linux-gnu/librt-2.21.so
6f678061f000-6f678081e000 ---p 00007000 08:01 786497                     /lib/x86_64-linux-gnu/librt-2.21.so
6f678081e000-6f678081f000 r--p 00006000 08:01 786497                     /lib/x86_64-linux-gnu/librt-2.21.so
6f678081f000-6f6780820000 rw-p 00007000 08:01 786497                     /lib/x86_64-linux-gnu/librt-2.21.so
6f6780820000-6f6780927000 r-xp 00000000 08:01 786483                     /lib/x86_64-linux-gnu/libm-2.21.so
6f6780927000-6f6780b26000 ---p 00107000 08:01 786483                     /lib/x86_64-linux-gnu/libm-2.21.so
6f6780b26000-6f6780b27000 r--p 00106000 08:01 786483                     /lib/x86_64-linux-gnu/libm-2.21.so
6f6780b27000-6f6780b28000 rw-p 00107000 08:01 786483                     /lib/x86_64-linux-gnu/libm-2.21.so
6f6780b28000-6f678169e000 r-xp 00000000 08:01 661281                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/server/libjvm.so
6f678169e000-6f678189d000 ---p 00b76000 08:01 661281                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/server/libjvm.so
6f678189d000-6f6781961000 rw-p 00b75000 08:01 661281                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/server/libjvm.so
6f6781961000-6f67819a2000 rw-p 00000000 00:00 0
6f6781961000-6f67819a2000 rw-p 00000000 00:00 0
6f67819a8000-6f6781b68000 r-xp 00000000 08:01 786503                     /lib/x86_64-linux-gnu/libc-2.21.so
6f6781b68000-6f6781d68000 ---p 001c0000 08:01 786503                     /lib/x86_64-linux-gnu/libc-2.21.so
6f6781d68000-6f6781d6c000 r--p 001c0000 08:01 786503                     /lib/x86_64-linux-gnu/libc-2.21.so
6f6781d6c000-6f6781d6e000 rw-p 001c4000 08:01 786503                     /lib/x86_64-linux-gnu/libc-2.21.so
6f6781d6e000-6f6781d72000 rw-p 00000000 00:00 0
6f6781d78000-6f6781d7b000 r-xp 00000000 08:01 786471                     /lib/x86_64-linux-gnu/libdl-2.21.so
6f6781d7b000-6f6781f7a000 ---p 00003000 08:01 786471                     /lib/x86_64-linux-gnu/libdl-2.21.so
6f6781f7a000-6f6781f7b000 r--p 00002000 08:01 786471                     /lib/x86_64-linux-gnu/libdl-2.21.so
6f6781f7b000-6f6781f7c000 rw-p 00003000 08:01 786471                     /lib/x86_64-linux-gnu/libdl-2.21.so
6f6781f80000-6f6781f95000 r-xp 00000000 08:01 661273                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/jli/libjli.so
6f6781f95000-6f6782194000 ---p 00015000 08:01 661273                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/jli/libjli.so
6f6782194000-6f6782195000 rw-p 00014000 08:01 661273                     /usr/lib/jvm/java-7-oracle/jre/lib/amd64/jli/libjli.so
6f6782198000-6f67821b0000 r-xp 00000000 08:01 786475                     /lib/x86_64-linux-gnu/libpthread-2.21.so
6f67821b0000-6f67823b0000 ---p 00018000 08:01 786475                     /lib/x86_64-linux-gnu/libpthread-2.21.so
6f67823b0000-6f67823b1000 r--p 00018000 08:01 786475                     /lib/x86_64-linux-gnu/libpthread-2.21.so
6f67823b1000-6f67823b2000 rw-p 00019000 08:01 786475                     /lib/x86_64-linux-gnu/libpthread-2.21.so
6f67823b2000-6f67823b6000 rw-p 00000000 00:00 0
6f67823b8000-6f67823dc000 r-xp 00000000 08:01 786474                     /lib/x86_64-linux-gnu/ld-2.21.so
6f67823e5000-6f67823ef000 rw-p 00000000 00:00 0
6f67823ef000-6f67824a5000 rw-p 00000000 00:00 0
6f67824a5000-6f67824a8000 ---p 00000000 00:00 0
6f67824a8000-6f67825a6000 rw-p 00000000 00:00 0                          [stack:6128]
6f67825c0000-6f67825c8000 rw-s 00000000 08:01 1311123                    /tmp/hsperfdata_root/6127
6f67825ce000-6f67825d0000 rw-p 00000000 00:00 0
6f67825d4000-6f67825d7000 rw-p 00000000 00:00 0
6f67825d7000-6f67825d8000 r--p 00000000 00:00 0
6f67825d8000-6f67825db000 rw-p 00000000 00:00 0
6f67825db000-6f67825dc000 r--p 00023000 08:01 786474                     /lib/x86_64-linux-gnu/ld-2.21.so
6f67825dc000-6f67825dd000 rw-p 00024000 08:01 786474                     /lib/x86_64-linux-gnu/ld-2.21.so
6f67825dd000-6f67825df000 rw-p 00000000 00:00 0
6f67825df000-6f67825e1000 r-xp 00000000 00:00 0                          [vdso]
715d736a8000-715d736ca000 rw-p 00000000 00:00 0                          [stack]
ffffffffff600000-ffffffffff601000 r--p 00000000 00:00 0                  [vsyscall]

VM Arguments:
jvm_args: -Xms256M -Xmx1024M
java_command: talendjobtest.forwardjson_0_1.ForwardJSON --context=Default
Launcher Type: SUN_STANDARD

Environment Variables:
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
SHELL=/bin/sh

Signal Handlers:
SIGSEGV: [libjvm.so+0x9a3b20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGBUS: [libjvm.so+0x9a3b20], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGFPE: [libjvm.so+0x81e740], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGPIPE: [libjvm.so+0x81e740], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGXFSZ: [libjvm.so+0x81e740], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGILL: [libjvm.so+0x81e740], sa_mask[0]=0x7ffbfeff, sa_flags=0x10000004
SIGUSR1: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGUSR2: [libjvm.so+0x81ffb0], sa_mask[0]=0x00000000, sa_flags=0x10000004
SIGHUP: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGINT: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGTERM: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000
SIGQUIT: SIG_DFL, sa_mask[0]=0x00000000, sa_flags=0x00000000


---------------  S Y S T E M  ---------------

OS:jessie/sid

uname:Linux 3.14.32-xxxx-grs-ipv6-64-vps #1 SMP Sat Feb 7 11:39:32 CET 2015 x86_64
libc:glibc 2.21 NPTL 2.21
rlimit: STACK 8192k, CORE 0k, NPROC 7963, NOFILE 65536, AS infinity
load average:0.13 0.04 0.05

/proc/meminfo:
MemTotal:        2039816 kB
MemFree:           84776 kB
MemAvailable:     150456 kB
Buffers:           31448 kB
Cached:            45968 kB
SwapCached:         8360 kB
Active:          1345272 kB
Inactive:         463056 kB
Active(anon):    1296372 kB
Inactive(anon):   438476 kB
Active(file):      48900 kB
Inactive(file):    24580 kB
Unevictable:           0 kB
Mlocked:               0 kB
SwapTotal:       2099196 kB
SwapFree:           9020 kB
Dirty:               384 kB
Writeback:             0 kB
AnonPages:       1722672 kB
Mapped:            23088 kB
Shmem:              3916 kB
Slab:              38616 kB
SReclaimable:      12896 kB
SUnreclaim:        25720 kB
KernelStack:       11776 kB
PageTables:        28396 kB
NFS_Unstable:          0 kB
Bounce:                0 kB
WritebackTmp:          0 kB
CommitLimit:     3119104 kB
Committed_AS:   14661200 kB
VmallocTotal:   34359738367 kB
VmallocUsed:      289572 kB
VmallocChunk:   34359346732 kB
HardwareCorrupted:     0 kB
DirectMap4k:       10176 kB
DirectMap2M:     2086912 kB
DirectMap1G:           0 kB


CPU:total 2 (1 cores per cpu, 1 threads per core) family 21 model 0 stepping 2, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, aes, mmxext, 3dnowpref, lzcnt, sse4a, tsc, tscinvbit, tscinv

/proc/cpuinfo:
processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 0
model name      : AMD Opteron(tm) Processor 6386 SE
stepping        : 2
microcode       : 0x6000822
cpu MHz         : 2799.999
cache size      : 2048 KB
physical id     : 0
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 0
initial apicid  : 0
fpu             : yes
fpu_exception   : yes
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:

processor       : 1
vendor_id       : AuthenticAMD
cpu family      : 21
model           : 0
model name      : AMD Opteron(tm) Processor 6386 SE
stepping        : 2
microcode       : 0x6000822
cpu MHz         : 2799.999
cache size      : 2048 KB
physical id     : 2
siblings        : 1
core id         : 0
cpu cores       : 1
apicid          : 2
initial apicid  : 2
fpu             : yes
fpu_exception   : yes
cpuid level     : 13
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 syscall nx mmxext fxsr_opt pdpe1gb rdtscp lm constant_tsc rep_good nopl tsc_reliable nonstop_tsc aperfmperf pni pclmulqdq ssse3 cx16 sse4_1 sse4_2 x2apic popcnt aes xsave avx hypervisor lahf_lm extapic cr8_legacy abm sse4a misalignsse 3dnowprefetch osvw xop fma4 arat vmmcall
bogomips        : 5599.99
TLB size        : 1536 4K pages
clflush size    : 64
cache_alignment : 64
address sizes   : 40 bits physical, 48 bits virtual
power management:



Memory: 4k page, physical 2039816k(84776k free), swap 2099196k(9020k free)

vm_info: Java HotSpot(TM) 64-Bit Server VM (24.80-b11) for linux-amd64 JRE (1.7.0_80-b15), built on Apr 10 2015 19:53:14 by "java_re" with gcc 4.3.0 20080428 (Red Hat 4.3.0-8)

time: Fri Aug 21 12:55:01 2015
elapsed time: 0 seconds

Linux版本:

# uname -a
Linux vps177513.ovh.net 3.14.32-xxxx-grs-ipv6-64-vps #1 SMP Sat Feb 7 11:39:32 CET 2015 x86_64 x86_64 x86_64 GNU/Linux

编辑 - 一些更有趣的事实:

# free -m
             total       used       free     shared    buffers     cached
Mem:          1992       1898         93          4         36         42
-/+ buffers/cache:       1819        172
Swap:         2049       2046          3

为了回应评论,我通过这个脚本运行JAR:

#!/bin/sh
cd `dirname $0`
 ROOT_PATH=`pwd`
 java -Xms256M -Xmx1024M -cp $ROOT_PATH:$ROOT_PATH/../lib/systemRoutines.jar:$ROOT_PATH/../lib/userRoutines.jar::.:$ROOT_PATH/forwardjson_0_1.ja r:$ROOT_PATH/../lib/camel-core-2.13.2.jar:$ROOT_PATH/../lib/commons-io-2.4.jar:$ROOT_PATH/../lib/cxf-api-2.7.12.jar:$ROOT_PATH/../lib/cxf-rt-bin dings-xml-2.7.12.jar:$ROOT_PATH/../lib/cxf-rt-core-2.7.12.jar:$ROOT_PATH/../lib/cxf-rt-frontend-jaxrs-2.7.12.jar:$ROOT_PATH/../lib/cxf-rt-rs-ext ension-providers-2.7.12.jar:$ROOT_PATH/../lib/cxf-rt-transports-http-2.7.12.jar:$ROOT_PATH/../lib/dom4j-1.6.1.jar:$ROOT_PATH/../lib/javax.ws.rs- api-2.0-m10.jar:$ROOT_PATH/../lib/jersey-client-1.4.jar:$ROOT_PATH/../lib/jersey-core-1.4.jar:$ROOT_PATH/../lib/jettison-1.3.5.jar:$ROOT_PATH/.. /lib/log4j-1.2.15.jar:$ROOT_PATH/../lib/mail.jar:$ROOT_PATH/../lib/slf4j-api-1.7.7.jar:$ROOT_PATH/../lib/slf4j-log4j12-1.7.7.jar:$ROOT_PATH/../l ib/stax-api-1.0.1.jar:$ROOT_PATH/../lib/stax2-api-3.1.4.jar:$ROOT_PATH/../lib/woodstox-core-asl-4.4.0.jar:$ROOT_PATH/../lib/wsdl4j-1.6.3.jar:$RO OT_PATH/../lib/xmlschema-core-2.1.0.jar: talendjobtest.forwardjson_0_1.ForwardJSON --context=Default "$@" root@vps177513:~/talend/ForwardJSON #

1 个答案:

答案 0 :(得分:1)

您需要一个分析器来查看随着时间的推移消耗内存的情况。我没有看到无状态Web服务如何继续咀嚼内存,除非你在某处泄漏。可能是烫发;可能是别的东西。测量;不要猜。

32位JVM不允许您分配超过2GB堆大小。