g*****g 发帖数: 34805 | 1 搞2G内存,启动的时候把 -Xms -Xmx使上。 |
|
t*****n 发帖数: 25 | 2 Program a fast and simple solution to the following problem without using
any
regular expression or pattern matching utilities. Given a non-finite stream
of
characters, output an "A" if the characters "xxx" are found in exactly that
sequence. If the characters "xMx" are found instead, output a "B". Do not
re-
process characters so as to output both an “A” and a “B” when processing
the
same input. For example:
1. The following input xxMxMxxxMxxx would produce the following output: BAA
2. The |
|
r*********r 发帖数: 3195 | 3 #include
#include
using std::cout;
using std::endl;
using std::string;
string process(const string& s)
{
string r;
for(int i=0; i
if( s.substr(i,3) == "xxx" ) {
i += 2;
r += 'A';
}
else if( s.substr(i,3) == "xMx") {
i += 2;
r += 'B';
}
}
return r;
}
int main()
{
cout << process("xxMxMxxxMxxx") << endl
<< process("xxxMxMxxxxMMxMxMx") << endl;
return 0;
} |
|
|
X****r 发帖数: 3557 | 5 乱讲。查momery leak要减小Xmx才方便。 |
|
|
|
d*****l 发帖数: 8441 | 8
谢谢! 命令行中-Xmx可以解决问题。
但是,Eclipse中如何设?
怎么在.jar(或manifest.txt)中设此选项呢?再谢! |
|
g*****g 发帖数: 34805 | 9 Get 4GB memory, eclipse is OK. Don't forget to configure
-Xmx in eclipse.ini file so it can take at least 1GB memory.
I am running 2 DB, 4 java app servers, one client and eclipse
all local on a 4GB laptop for development purpose. And it
works fine. |
|
g*****g 发帖数: 34805 | 10 Eclipse is actually quite stable. But there a couple things newbies that
don't know.
1. You need enough memory. At least 4GB physical
2. You need configure eclipse.ini and give it more memory for Xms, Xmx
and PermSize.
I have 30 projects and 10s of thousands of source files. Eclipse handles
it fine.
configure
with
w/
is |
|
g*****g 发帖数: 34805 | 11 Start with Xms and Xmx. |
|
n******7 发帖数: 12463 | 12 我的问题是,什么样的Xms Xmx可以导致什么样的内存用量?
要自己测试估计得用不同的参数跑几个job,然后看内存用量吧?
我对于系统在128G node自动决定的参数很满意,不知道怎么能知道jvm自己决定的参数
是多少呢? |
|
w**z 发帖数: 8232 | 13 xmx controls the max memory allocated to heap. make sure you use the same
JVM parameters when comparing. |
|
g*****g 发帖数: 34805 | 14 Set the same parameters for both systems. For any serious server app, you
should always set Xmx at the very least. There are references on what these
parameters mean and there are 50 others you can tweak. |
|
n******7 发帖数: 12463 | 15 主要两个目的:
1. 尽量减少内存使用。因为在cluster上跑job有cpu和内存配额,需要的内存越少越好
2. 我本来琢磨触发GC会降低运行效率,所以想测试不同参数下运行时间,在内存使用
和运行时间之间找一个平衡。 不过这个结果似乎说明,GC不是问题,最快的结果是在
XMX参数最小的时候获得的。另外XMS参数不宜过大。
我结果里面的mem用量是每个参数下极限mem使用量,所以还是可比的。我的job必须指
定比这个量大的mem用量才不会被杀掉 |
|
n******7 发帖数: 12463 | 16 不错,这样只用测试XMX就好,更省事了
that
t |
|
a***n 发帖数: 538 | 17 据说xmx不要超过4g。java7以后的g1gc好像比较好,我没有测出区别来,不过好像停顿
会变小。 |
|
n******7 发帖数: 12463 | 18 你是说xms吧?xmx不是总的memory pool size吗?这个没法给上限吧 |
|
|
c********w 发帖数: 308 | 20 加了Xmx和concurMarkAndSweep..多线程还是不行。网上查了下这种情况也不少,可以
是运算不够复杂,不足以掩盖threading overhead...
现在多进程的做的差不多了,就是你前面说的python break up input into multiple
chunks 然后启动多个Java进程并行处理,最后write to separate files. Python再合
并成一个。效果不错。估计就只能这样了。不知道怎么再调多线程了。。 |
|
t*****z 发帖数: 1598 | 21 JAVA程序的命令行都太冗长了,简直反人类,而且时不时还要考虑内存问题。比如给
BAM文件排序,Picard是:
java -Xmx???g -jar picard.jar SortSam INPUT=unsorted.bam OUTPUT=sorted.bam
SORT_ORDER=coordinate
而SAMtools仅仅是:
samtools sort input.bam
我常用SAMtools配合Bash的pipe整出高效且干净的one-liner,例如去除某些序列:
bowtie2 -p 16 -x /path/to/db -1 in_R1.fq -2 in_R2.fq | samtools view -f 12 -
F 256 | samtools sort -@ 16 -n | samtools view -bS | bedtools bamtofastq -i
- -fq out_R1.fq -fq2 out_R2.fq &> output.log
不知道Picard能不能? |
|