gpt4 book ai didi

java - 有没有办法在同一台服务器上运行两个JVM?

转载 作者:行者123 更新时间:2023-12-01 23:48:08 26 4
gpt4 key购买 nike

我在 JVM 方面遇到了一些问题;我有一个网页和一个没有 GUI(UDP 服务器)的应用程序,并且两者都使用相同的数据库,应用程序(UDP 服务器)工作正常,但如果 Web 应用程序内存不足,整个 JVM 就会停止;所以我想把UDP服务器放在不同的JVM中。

我收到以下消息

May 21, 2013 5:24:05 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
SEVERE: The web application [/track] created a ThreadLocal with key of type [org.opengts.util.ThreadLocalMap$1] (value [org.opengts.util.ThreadLocalMap$1@277085a4]) and a value of type [java.util.Hashtable] (value [{jdbc:mysql://localhost:3306/gts?characterEncoding=UTF-8&useUnicode=true&characterSetResults=utf8=org.opengts.dbtools.DBConnection@22236dae}]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

当我重新启动网页时

May 21, 2013 5:24:20 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 2695 ms
Exception in thread "http-bio-8080-Acceptor-0" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:657)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:943)
at java.util.concurrent.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:1336)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:176)
at org.apache.tomcat.util.threads.ThreadPoolExecutor.execute(ThreadPoolExecutor.java:156)
at org.apache.tomcat.util.net.JIoEndpoint.processSocket(JIoEndpoint.java:510)
at org.apache.tomcat.util.net.JIoEndpoint$Acceptor.run(JIoEndpoint.java:229)
at java.lang.Thread.run(Thread.java:679)
Exception in thread "http-bio-8080-exec-8" java.lang.OutOfMemoryError: unable to create new native thread
at java.lang.Thread.start0(Native Method)
at java.lang.Thread.start(Thread.java:657)
at java.util.concurrent.ThreadPoolExecutor.addWorker(ThreadPoolExecutor.java:943)
at java.util.concurrent.ThreadPoolExecutor.processWorkerExit(ThreadPoolExecutor.java:992)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:679)

新信息

我尝试使用 ulimit 命令得到以下结果。

ulimit
unlimited
ulimit -Hn
163840
ulimit -n
163840
ulimit -u
1024

现在我想知道这些数字的含义是什么?它们是进程或内存量(以 MB 为单位)?

最佳答案

你必须在不同的端口上运行网络服务器所以这不是 JVM 问题 - 这是 catalina 的配置

关于java - 有没有办法在同一台服务器上运行两个JVM?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16679487/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com