上一页 1 ··· 520 521 522 523 524 525 526 527 528 ··· 542 下一页
摘要: 核心提示:原因有很多种,比如: 1.数据量过于庞大;死循环 ;静态变量和静态方法过多;递归;无法确定是否被引用的对象; 2.虚拟机不回收内存(内存泄漏); 说白了就是程序运行要用到的内存大于虚拟机能提供的最大内存就发生内存溢出了。 内存溢出的问题要看业务和系 原因有很多种,比如:1.数据量过于庞大;死循环 ;静态变量和静态方法过多;递归;无法确定是否被引用的对象;2.虚拟机不回收内存(内存泄漏); 说白了就是程序运行要用到的内存大于虚拟机能提供的最大内存就发生内存溢出了。 内存溢出的问题要看业务和系统大小而定,对于某些系统可能内存溢出不常见,但某些系统还是很常见的解决的方法,一个是优化程序代码 阅读全文
posted @ 2011-06-10 10:31 规格严格-功夫到家 阅读(2419) 评论(1) 推荐(1) 编辑
摘要: 一、框架代码的实现使用Socket是最完美的的远程连接超时设置技术,下面是创建Socket对象的代码: 建立连接一般的写法是:Socket s = new Socket(host, port); 而要定制超时的写法则为:SocketAddress addr = new InetSocketAddress(host, port);Socket s = new Socket();s.connect(addr, timeoutInMilliSeconds);这种写法使用了底层的socket技术。如果使用JMX远程管理API, 通常不能访问socket。如果一定要使用这种技术的话,需颇费一番周折。其工 阅读全文
posted @ 2011-06-09 16:47 规格严格-功夫到家 阅读(1884) 评论(0) 推荐(0) 编辑
摘要: ManagementFactory.getPlatformMBeanServer() returns a reference to the existing MBean server within the JVM. JConsole looks at the beans on that server.If you use createMBeanServer(), that will create an entirely new server. JConsole has no knowledge of it, and so will not see the beans registered wi 阅读全文
posted @ 2011-06-09 14:42 规格严格-功夫到家 阅读(1903) 评论(0) 推荐(0) 编辑
摘要: http://lindows.iteye.com/blog/456641 http://code.google.com/p/javasimon/downloads/list 阅读全文
posted @ 2011-06-09 10:50 规格严格-功夫到家 阅读(174) 评论(0) 推荐(0) 编辑
摘要: publicclassSort{publiclong[]array;//冒泡排序publicvoidbublingSort(long[]array){intlength=array.length;longtemp;for(inti=length;i>0;i--){for(intj=0;j<i-1;j++){if(array[j]>array[j+1]){temp=array[j+1];array[j+1]=array[j];array[j]=temp;}}}}//选择排序publicvoidselectSort(long[]array){intlength=array.len 阅读全文
posted @ 2011-06-09 10:36 规格严格-功夫到家 阅读(240) 评论(0) 推荐(0) 编辑
摘要: http://extjs2.iteye.com/blog/394128http://www.walkerwen.com/?p=313http://blog.csdn.net/closewbq/archive/2010/06/30/5704158.aspx 阅读全文
posted @ 2011-06-08 15:05 规格严格-功夫到家 阅读(132) 评论(0) 推荐(0) 编辑
摘要: log4j.rootLogger=DEBUG,CONSOLE,DATABASE,FILElog4j.addivity.org.apache=true# 应用于控制台log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppenderlog4j.appender.CONSOLE.Threshold=INFOlog4j.appender.CONSOLE.Target=System.outlog4j.appender.CONSOLE.Encoding=GBKlog4j.appender.CONSOLE.layout=org.apache.log4j.Patt 阅读全文
posted @ 2011-06-08 13:58 规格严格-功夫到家 阅读(216) 评论(0) 推荐(0) 编辑
摘要: 具体方法如下:以ls的man为例man ls |col -b >ls.txt将info变成文本,以make为例info make -o make.txt -s 阅读全文
posted @ 2011-06-08 13:57 规格严格-功夫到家 阅读(191) 评论(0) 推荐(0) 编辑
摘要: 锁机制(lock) 是多线程编程中最常用的同步机制,用来对多线程间共享的临界区(Critical Section) 进行保护。Pthreads提供了多种锁机制,常见的有:1) Mutex(互斥量):pthread_mutex_***2) Spin lock(自旋锁):pthread_spin_***3) Condition Variable(条件变量):pthread_con_***4) Read/Write lock(读写锁):pthread_rwlock_***在多线程编中,根据应用场合的不同,选择合适的锁来进行同步,对多线程程序的性能影响非常大. 本文主要对 pthread_mutex 阅读全文
posted @ 2011-06-07 09:45 规格严格-功夫到家 阅读(10885) 评论(1) 推荐(1) 编辑
摘要: 1、利用System.getProperty()函数获取当前路径:System.out.println(System.getProperty("user.dir"));//user.dir指定了当前的路径2、使用File提供的函数获取当前路径:File directory = new File("");//设定为当前文件夹try{ System.out.println(directory.getCanonicalPath());//获取标准的路径 System.out.println(directory.getAbsolutePath());//获取绝对 阅读全文
posted @ 2011-06-06 11:42 规格严格-功夫到家 阅读(135982) 评论(3) 推荐(3) 编辑
上一页 1 ··· 520 521 522 523 524 525 526 527 528 ··· 542 下一页