jmap查看内存使用情况与生成heapdump--转
如果想分析自己的JAVAApplication时,可以使用jmap程序来生成heapdump文件。例:jmap-heap1234(1234为进程号)jmap是JDK自带的一个工具,非常小巧方便,其支持参数如下:-heap打印heap空间的概要,这里可以粗略的检验heap空间的使用情况。例:jmap-
请别再拿“String s = new String("xyz");创建了多少个String实例”来
羞愧呀,不知道多少人干过,我也干过,面壁去!这帖是用来回复高级语言虚拟机圈子里的一个问题,一道Java笔试题的。本来因为见得太多已经吐槽无力,但这次实在忍不住了就又爆发了一把。写得太长干脆单独开了一帖。顺带广告:对JVM感兴趣的同学们同志们请多多支持高级语言虚拟机圈子以下是回复内容。文中的“楼主”是
JAVA的静态代理与动态代理比较--转载
事后处理消息等。例程1HelloService.javapackageproxy;importjava.util.Date;publicinterfaceHelloService{publicStringecho(Stringmsg);publicDategetTime();}例程2HelloSer
jstl核心标签使用
JSTL核心标签库标签共有13个,功能上分为4类:1.表达式控制标签:out、set、remove、catch2.流程控制标签:if、choose、when、otherwise3.循环标签:forEach、forTokens4.URL操作标签:import、url、redirect1.out属性名是
详解Java解析XML的四种方法(转载)
原文地址:http://developer.51cto.com/art/200903/117512.htmXML现在已经成为一种通用的数据交换格式,它的平台无关性,语言无关性,系统无关性,给数据集成与交互带来了极大的方便。对于XML本身的语法知识与技术细节,需要阅读相关的技术文献,这里面包括的内容有
servlet实现http通信基础
1.客户端发送http报文http协议是建立在TCP/UDP协议之上,封装了socket通信(TCP/UDP需要使用)的细节。即客户端通过实现了TCP或者UDPsocket通信的http客户端发送http消息给servlet。图片:暂时不支持2.servlet处理报文httpservlet启动了So
Java Interview Reference Guide--reference
Part1http://techmytalk.com/2014/01/24/java-interview-reference-guide-part-1/PostedonJanuary24,2014byNitinKumarJAVAObjectOrientedConceptsJavainbasedonO
Eclipse Key Shortcuts for Greater Developers Produ
PostedbyAjiteshKumar/InJava/June6,2014http://vitalflux.com/eclipse-key-shortcuts-greater-developers-productivity/ThearticlepresentsEclipseKeyShortcuts
Load resources from classpath in Java--reference
IngeneralclasspathisthepathwhereJVMcanfind.classfilesandresourcesofyourapplicationandinthistutorialwewillseehowtoloadresourcessuchas.propertiesfilesth
用java读取properties文件--转
今天为了通过java读取properties文件,google了很长时间,终于找到了。现在特记录之和大家一起分享。下面直接贴出代码:java类publicclassMytestpublicstaticvoidreadFile(StringfileName){//传入参数fileName是要读取的资源
Regular Expressions in Grep Command with 10 Exampl
Regularexpressionsareusedtosearchandmanipulatethetext,basedonthepatterns.MostoftheLinuxcommandsandprogramminglanguagesuseregularexpression.Grepcommand
Servlet 工作原理解析--转载
创建Servlet实例前面已经完成了Servlet的解析工作,并且被包装成StandardWrapper添加在Context容器中,但是它仍然不能为我们工作,它还没有被实例化。下面我们将介绍Servlet对象是如何创建的,以及如何被初始化的。创建Servlet对象如果Servlet的load-on-
深入分析 iBATIS 框架之系统架构与映射原理--转载
http://www.ibm.com/developerworks/cn/java/j-lo-ibatis-principle/iBATIS通过SQLMap将Java对象映射成SQL语句和将结果集再转化成Java对象,与其他ORM框架相比,既解决了Java对象与输入参数和结果集的映射,又能够让用户方
JDK源码重新编译——支持eclipse调试JDK源码--转载
最近在研究jdk源码,发现debug时无法查看源码里的变量值。因为sun提供的jdk并不能查看运行中的局部变量,需要重新编译一下rt.jar。下面这六步是编译jdk的具体步骤:Step1:LocatetheJDKsourceFirstnavigatetotheJDKinstalldirectory,
Getting started with new I/O (NIO)--reference-3
BufferslicingTheslice()methodcreatesakindofsub-bufferfromanexistingbuffer.Thatis,itcreatesanewbufferthatsharesitsdatawithaportionoftheoriginalbuffer.T
Getting started with new I/O (NIO)--reference-2
BufferinternalsBufferinternalsoverviewInthissection,we'lllookattwoimportantcomponentsofbuffersinNIO:statevariablesandaccessormethods.Statevariablesare
Getting started with new I/O (NIO)--reference
Thenewinput/output(NIO)library,introducedwithJDK1.4,provideshigh-speed,block-orientedI/OinstandardJavacode.Thishands-ontutorialcoverstheNIOlibraryingr
An NIO.2 primer--reference-3
OurfirstexampledemonstratesthenewFileVisitorAPI.Imagineascenarioinwhichyouwanttotraverseadirectorytreerecursively,stoppingateachfileanddirectoryundert
An NIO.2 primer--reference-2
AsynchronouschannelgroupsEachasynchronouschannelconstructedbelongstoachannelgroupthatsharesapoolofJavathreads,whichareusedforhandlingthecompletionofin
An NIO.2 primer--reference
ation:if(!future.isDone()){future.cancel(true);}Thecancel()methodtakesabooleanflagtoindicatewhetherthethreadperformingtheacceptcanbeinterrupted.Thisis