0

我刚得到一个新的 Ubuntu 12.04LTS 虚拟机(Proxmox 1.9)实例。我做了以下工作:

  1. 安装 Sun Java 7 JDK 并设置 JAVA_HOME
  2. 下载 Grails 2.2.0 并设置 GRAILS_HOME 和 PATH

跑步

$ grails

总是卡在:

| Loading Grails 2.2.0

或者有时它会达到

| Configuring classpath

我只能使用kill -9 <pid> / 来终止进程:我也遇到了以下异常:

$ grails          
Exception in thread "Reference Handler" java.lang.IllegalMonitorStateException
    at java.lang.Object.notifyAll(Native Method)
    at java.lang.ref.ReferenceQueue.enqueue(ReferenceQueue.java:68)
    at java.lang.ref.Reference$ReferenceHandler.run(Reference.java:146)



$ free -m
             total       used       free     shared    buffers     cached
Mem:          4096       1129       2966          0          0       1129
-/+ buffers/cache:          0       4096
Swap:            0          0          0


$ java -version
java version "1.7.0_11"
Java(TM) SE Runtime Environment (build 1.7.0_11-b21)
Java HotSpot(TM) 64-Bit Server VM (build 23.6-b04, mixed mode)
$ javac -version
javac 1.7.0_11

我试过寻找任何系统日志但没有运气......只是这个Java日志跟踪......很长一个 http://pastebin.com/raw.php?i=YEesBGXn

使用以下 JAVA_OPTS 运行

$ echo $JAVA_OPTS
-verbose:gc -XX:+PrintGCDetails -Dgrails.env=development -server -Xmx512M -XX:MaxPermSize=256m

显示了一个非常不寻常的垃圾收集,比我的本地机器上的要快得多,仅在第二个 30 个周期内!!!!

$ grails
[GC [DefNew: 13336K->933K(19648K), 0.0034700 secs] 13336K->933K(63360K), 0.0035060 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 
[GC [DefNew: 12566K->806K(19648K), 0.0029880 secs] 12566K->806K(63360K), 0.0030090 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 
[GC [DefNew: 10728K->640K(19648K), 0.0020080 secs] 10728K->640K(63360K), 0.0020290 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 10717K->625K(19648K), 0.0021550 secs] 10717K->625K(63360K), 0.0021740 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 
[GC [DefNew: 11185K->895K(19648K), 0.0028080 secs] 11185K->895K(63360K), 0.0028280 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 
[GC [DefNew: 11239K->966K(19648K), 0.0027430 secs] 11239K->966K(63360K), 0.0027640 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 
[GC [DefNew: 11190K->959K(19648K), 0.0028930 secs] 11190K->959K(63360K), 0.0029140 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 10801K->931K(19648K), 0.0027570 secs] 10801K->931K(63360K), 0.0027790 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 
[GC [DefNew: 11730K->1483K(19648K), 0.0032850 secs] 11730K->1483K(63360K), 0.0033060 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 12693K->791K(19648K), 0.0036170 secs] 12693K->1286K(63360K), 0.0036380 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 
[GC [DefNew: 10694K->623K(19648K), 0.0025120 secs] 11189K->1118K(63360K), 0.0025320 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 10457K->596K(19648K), 0.0016330 secs] 10952K->1091K(63360K), 0.0016540 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 10475K->604K(19648K), 0.0016960 secs] 10970K->1099K(63360K), 0.0017170 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 10500K->621K(19648K), 0.0017230 secs] 10995K->1116K(63360K), 0.0017600 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 11960K->848K(19648K), 0.0023630 secs] 12455K->1343K(63360K), 0.0023830 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 
[GC [DefNew: 10656K->736K(19648K), 0.0020860 secs] 11151K->1231K(63360K), 0.0021090 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 
[GC [DefNew: 10706K->785K(19648K), 0.0022890 secs] 11201K->1330K(63360K), 0.0023100 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 12704K->1209K(19648K), 0.0031890 secs] 13249K->1754K(63360K), 0.0032090 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 
[GC [DefNew: 11009K->988K(19648K), 0.0030880 secs] 11555K->1737K(63360K), 0.0031090 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 10910K->1042K(19648K), 0.0026880 secs] 11659K->1791K(63360K), 0.0027080 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 
[GC [DefNew: 11699K->1233K(19648K), 0.0029880 secs] 12447K->1990K(63360K), 0.0030080 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 11312K->1098K(19648K), 0.0032090 secs] 12069K->2088K(63360K), 0.0032280 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 11480K->1169K(19648K), 0.0028980 secs] 12470K->2199K(63360K), 0.0029190 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 
[GC [DefNew: 11067K->996K(19648K), 0.0028780 secs] 12096K->2199K(63360K), 0.0028980 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 10838K->987K(19648K), 0.0023150 secs] 12040K->2189K(63360K), 0.0023360 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 10785K->989K(19648K), 0.0020500 secs] 11988K->2192K(63360K), 0.0020700 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 10842K->1010K(19648K), 0.0020970 secs] 12044K->2212K(63360K), 0.0021170 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 11668K->1184K(19648K), 0.0024270 secs] 12870K->2386K(63360K), 0.0024470 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 11840K->854K(19648K), 0.0030320 secs] 13043K->2572K(63360K), 0.0030540 secs] [Times: user=0.00 sys=0.00, real=0.01 secs] 

[GC [DefNew: 11890K->1345K(19648K), 0.0025590 secs] 13608K->3063K(63360K), 0.0025810 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 
[GC [DefNew: 11306K->1007K(19648K), 0.0022660 secs] 13024K->3022K(63360K), 0.0022860 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 10991K->1059K(19648K), 0.0017130 secs] 13006K->3074K(63360K), 0.0017360 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 11440K->1255K(19648K), 0.0023460 secs] 13455K->3270K(63360K), 0.0023690 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 
[GC [DefNew: 11989K->1298K(19648K), 0.0024010 secs] 14004K->3490K(63360K), 0.0024230 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 18770K->1948K(19648K), 0.0051470 secs] 20962K->4504K(63360K), 0.0051710 secs] [Times: user=0.02 sys=0.00, real=0.01 secs] 
| Loading Grails 2.2.0
[GC [DefNew: 15322K->1119K(19648K), 0.0060270 secs] 18786K->5620K(63360K), 0.0060520 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 
[GC [DefNew: 12134K->1357K(19648K), 0.0036970 secs] 16635K->5913K(63360K), 0.0037210 secs] [Times: user=0.01 sys=0.00, real=0.00 secs] 
[GC [DefNew: 18695K->2148K(19648K), 0.0078430 secs] 23251K->7738K(63360K), 0.0078680 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 
[GC [DefNew: 15902K->825K(19648K), 0.0071910 secs] 21492K->8544K(63360K), 0.0072170 secs] [Times: user=0.01 sys=0.00, real=0.01 secs] 
[GC [DefNew: 10669K->815K(19648K), 0.0028670 secs] 18388K->8535K(63360K), 0.0028910 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
[GC [DefNew: 12030K->1121K(19648K), 0.0037650 secs] 19750K->8840K(63360K), 0.0037880 secs] [Times: user=0.00 sys=0.00, real=0.00 secs] 
| Downloading: ivy-1.0.xml
| Downloading: ivy-3.2.3.xml

关于这里可能有什么问题的任何想法?

非常感谢,

阿米特。

4

2 回答 2

1

这不是 Proxmox 的问题,而是 OpenVZ 的问题。如果您使用 Proxmox,我建议您使用 kvm 实例。不过OpenVZ用IBM JDK好像没问题,也许你可以试试IBM的Java运行时。你最好不要在 OpenVZ 中运行 JVM。

于 2013-02-04T12:22:12.497 回答
0

解决了。

这是此处描述的 Proxmox 虚拟机的问题:http: //forum.proxmox.com/archive/index.php/t-6998.html

它有助于为机器提供更多的 CPU 能力。

于 2013-01-17T14:44:32.287 回答