top查看java占用的内存比较多

  1. top - :: up days, :, user, load average: 0.03, 0.05, 0.05
  2. Tasks: total, running, sleeping, stopped, zombie
  3. %Cpu(s): 0.0 us, 1.3 sy, 0.0 ni, 98.7 id, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
  4. KiB Mem : total, free, used, buff/cache
  5. KiB Swap: total, free, used. avail Mem
  6.  
  7. PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
  8. root .598g S 0.0 20.5 :01.18 jsvc
  9. root .323g S 0.0 17.0 :32.59 jsvc
  10. root .136g S 0.0 14.6 :06.62 jsvc
  11. root S 0.0 9.2 :19.24 jsvc

可见每个占用了大概20%,还是比较高的,因为要部署新的服务,腾内存了

使用jstack查看一下进程的状态,其实也没什么用,不过我昨天刚学的java GC,就试用一下

  1. jstack -F
  2. Attaching to process ID , please wait...
  3. Debugger attached successfully.
  4. Server compiler detected.
  5. JVM version is 25.111-b14
  6. Deadlock Detection:
  7.  
  8. No deadlocks found.
  9.  
  10. Thread : (state = BLOCKED)
  11.  
  12. Thread : (state = BLOCKED)
  13. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  14. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  15. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Compiled frame)
  16. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  17. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  18. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  19. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  20. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  21. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  22.  
  23. Thread : (state = BLOCKED)
  24. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  25. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  26. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Compiled frame)
  27. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  28. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  29. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  30. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  31. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  32. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  33.  
  34. Thread : (state = BLOCKED)
  35. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  36. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  37. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Compiled frame)
  38. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  39. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  40. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  41. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  42. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  43. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  44.  
  45. Thread : (state = BLOCKED)
  46. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  47. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  48. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Compiled frame)
  49. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  50. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  51. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  52. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  53. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  54. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  55.  
  56. Thread : (state = BLOCKED)
  57. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  58. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  59. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Compiled frame)
  60. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  61. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  62. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  63. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  64. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  65. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  66.  
  67. Thread : (state = BLOCKED)
  68. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  69. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  70. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Compiled frame)
  71. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  72. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  73. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  74. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  75. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  76. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  77.  
  78. Thread : (state = BLOCKED)
  79. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  80. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  81. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Compiled frame)
  82. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  83. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  84. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  85. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  86. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  87. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  88.  
  89. Thread : (state = BLOCKED)
  90. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  91. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  92. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Compiled frame)
  93. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  94. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  95. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  96. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  97. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  98. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  99.  
  100. Thread : (state = BLOCKED)
  101. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  102. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  103. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Compiled frame)
  104. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  105. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  106. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  107. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  108. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  109. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  110.  
  111. Thread : (state = BLOCKED)
  112. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  113. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  114. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Compiled frame)
  115. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  116. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  117. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  118. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  119. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  120. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  121.  
  122. Thread : (state = BLOCKED)
  123. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  124. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  125. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Interpreted frame)
  126. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  127. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  128. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  129. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  130. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  131. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  132.  
  133. Thread : (state = BLOCKED)
  134. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  135. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  136. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Interpreted frame)
  137. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  138. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  139. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  140. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  141. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  142. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  143.  
  144. Thread : (state = BLOCKED)
  145. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  146. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  147. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Interpreted frame)
  148. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  149. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  150. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  151. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  152. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  153. - java.lang.Thread.run() @bci=, line= (Interpreted frame)
  154.  
  155. Thread : (state = BLOCKED)
  156. - sun.misc.Unsafe.park(boolean, long) @bci= (Compiled frame; information may be imprecise)
  157. - java.util.concurrent.locks.LockSupport.park(java.lang.Object) @bci=, line= (Compiled frame)
  158. - java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await() @bci=, line= (Interpreted frame)
  159. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  160. - java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take() @bci=, line= (Compiled frame)
  161. - java.util.concurrent.ThreadPoolExecutor.getTask() @bci=, line= (Compiled frame)
  162. - java.util.concurrent.ThreadPoolExecutor.runWorker(java.util.concurrent.ThreadPoolExecutor$Worker) @bci=, line= (Interpreted frame)
  163. - java.util.concurrent.ThreadPoolExecutor$Worker.run() @bci=, line= (Interpreted frame)
  164. - java.lang.Thread.run() @bci=, line= (Interpreted frame)

后边不贴了,总之就是有大量的BLOCKED,这个程序说是bug导致的,下一个版本会修正,另外其他的进程实在IN_NATIVE状态,因为JAVA底层其实是C语言实现的,这个就是在执行C语言的调用,native

我竟然还以为是inactive,Naive

使用jstat分析一下gc,命令格式jstat -gc -t <PID>

  1. jstat -gc -t
  2. Timestamp S0C S1C S0U S1U EC EU OC OU MC MU CCSC CCSU YGC YGCT FGC FGCT GCT
  3. 484036.7 2048.0 2048.0 0.0 1296.0 694784.0 234952.5 1398272.0 259033.6 59136.0 57496.9 6400.0 6017.4 10.073 0.254 10.327

这里面S0C和S1C是两个survivor的容量,S0U和S1U是两个survivor已经使用的容量,EC和EU分别是新生代容量和已用容量,OC和OU是老年代的容量和已用,MC和MU是方法区的容量和使用大小,CCSC和CCSU是压缩类空间容量和使用大小,YGC是minor GC的次数,YGCT是minorGC的总计时间,FGC是major GC的次数,FGCT是major GC的时间,GCT是总共GC的占用时间。

其实这里还可以获取一下内存快照的,方法是

jmap -dump:format=b,file=heap.bin <pid>
file:保存路径及文件名
pid:进程编号(windows通过任务管理器查看,linux通过ps aux查看)

分析工具从http://www.eclipse.org/mat/下载,可惜我这里没有,所以说就算了吧

言归正传,用jmap分析下总的heap,heap就是堆,这里说下,堆和栈是有区别的,堆是存储变量,栈存储的是命令。堆是可以由应用程序来修改和申请空间,栈是由系统来管理的

  1. root@localhost:~# jmap -heap
  2. Attaching to process ID , please wait...
  3. Debugger attached successfully.
  4. Server compiler detected.
  5. JVM version is 25.111-b14
  6.  
  7. using thread-local object allocation.
  8. Parallel GC with thread(s)
  9.  
  10. Heap Configuration:
  11. MinHeapFreeRatio =
  12. MaxHeapFreeRatio =
  13. MaxHeapSize = (.0MB)
  14. NewSize = (.5MB)
  15. MaxNewSize = (.5MB)
  16. OldSize = (.5MB)
  17. NewRatio =
  18. SurvivorRatio =
  19. MetaspaceSize = (.796875MB)
  20. CompressedClassSpaceSize = (.0MB)
  21. MaxMetaspaceSize = MB
  22. G1HeapRegionSize = (.0MB)
  23.  
  24. Heap Usage:
  25. PS Young Generation
  26. Eden Space:
  27. capacity = (.5MB)
  28. used = (.6439056396484MB)
  29. free = (.856094360351562MB)
  30. 96.33661100068511% used
  31. From Space:
  32. capacity = (.0MB)
  33. used = (.001068115234375MB)
  34. free = (.998931884765625MB)
  35. 50.05340576171875% used
  36. To Space:
  37. capacity = (.0MB)
  38. used = (.0MB)
  39. free = (.0MB)
  40. 0.0% used
  41. PS Old Generation
  42. capacity = (.5MB)
  43. used = (.53402709960938MB)
  44. free = (.9659729003906MB)
  45. 18.493887008393216% used

震惊!运维工程师用jmap分析jvm,竟然……

Eden看起来有点高了,但是其实这么说也是不公平的,Eden(伊甸园)区满了就会触发minorGC,把不活跃的对象清理掉,几次GC后还没有被清理掉的进入survivor,还能幸存的进入老年代,所以如果一个进程说Linux的哪一块内存没有去过,其实潜台词就是他老了(逃

不过Eden还是不能太小了,否则如果被活跃的对象占满了,GC不会处理这些对象,新的对象一直等着进不来,就会造成进程假死了,参考文献

http://www.cnblogs.com/jackchen001/p/6902909.html

或者温和一点,大量的对象放进老生代,导致频繁的full GC,full GC是要暂停程序的,并且会占用大量的CPU,导致性能下降

http://blog.csdn.net/hengyunabc/article/details/24924843

现在就比较简单了,使用java -XX就可以调整了

这里可以看到NewRatio是2,那么就是NewGeneration:OldGeneration = 1:2,new占了1/3的空间,old占了2/3,这里调整一下,把总体从原来的2G调整到1G就可以了,这样老年代空间和新生代空间都缩小了一半,YGC会频繁一点,但是YGC很快,不太会影响,只要老年区不被沾满就行,如果还不放心可以把新生代调大一点,SUN官方推荐新生代为整体的3/8。SurvivoRatio是连个Survivor区与Eden区的大小比值,8就是Eden:Survivor=8:2

  1. java -Xmx1024m -Xmn374m

这样调整后感觉好多了

参考文献

http://www.cnblogs.com/redcreen/archive/2011/05/04/2037057.html

http://www.importnew.com/1993.html

jvm 内存调整的更多相关文章

  1. JVM内存调整

    JVM内存调整 先试着调整一下idea的 找到软件安装位置/bin/idea64.exe.vmoptions 给他直接整个起飞的,改成 -Xms512m -Xmx1500m 找到Java安装的位置/j ...

  2. 一次JVM内存调整

    单台服务器8G内存,2核 系统里装了redis, rocketmq, mysql, zookeeper, 还有20个左右的微服务,每个微服务的jvm 参数 -Xms128m -Xmx256m -Xmn ...

  3. JBoss - 调整JVM内存 -Xms512m -Xmx1024m

    $JBOSS-HOME/server/下有3个目录,all/default/minimal,它们是表示3种配置,全部的配置.默认配置.最小配置,我们在启动JBOSS服务时,可以指定 run –c al ...

  4. javaweb学习总结九(xml解析以及调整JVM内存大小)

    一:解析XML文件的两种方式 1:dom,document object model,文档对象模型. 2:sax,simple API for XML. 3:比较dom和sax解析XML文件的优缺点 ...

  5. Java SE之调整JVM内存笔记

    [文档整理系列]  Java SE之调整JVM内存笔记 一般JVM内存限制是64Mbyte Eclipse下 Run as configrationArguments选项:-Xmx80m [设置虚拟机 ...

  6. JVM内存限制和调整

    今天用java -jar执行一个jar文件提示内存不够,需要设置虚拟机的堆大小.以下是参考资料: 堆(Heap)和非堆(Non-heap)内存  按照官方的说法:“Java 虚拟机具有一个堆,堆是运行 ...

  7. 调整JVM内存大小

    首次运行公司项目,出现了内存溢出,具体出现java.lang.OutOfMemoryError: PermGen space和java.lang.OutOfMemoryError:GC overhea ...

  8. Java调整JVM内存大小——(八)

    JVM内存大小是有限的,有的时候程序过大时候会导致超出最大内存,产生下面异常: Exception in thread "main" java.lang.OutOfMemoryEr ...

  9. JVM内存管理------垃圾搜集器参数精解

    本文是GC相关的最后一篇,这次LZ只是罗列一下hotspot JVM中垃圾搜集器相关的重点参数,以及各个参数的解释.废话不多说,这就开始. 垃圾搜集器文章传送门 JVM内存管理------JAVA语言 ...

随机推荐

  1. html to pdf小工具,支持evernote导出的html和firefox插件scrapbook

    周末花了一天时间用wpf写了一个html转换为pdf的小工具. 已经在win7 32位 和win8 64两台机器上测试,目前基本可用,特拿来分享. 程序下载地址:http://pan.baidu.co ...

  2. 【BZOJ4285】使者 cdq分治+扫描线+树状数组

    [BZOJ4285]使者 Description 公元 8192 年,人类进入星际大航海时代.在不懈的努力之下,人类占领了宇宙中的 n 个行星,并在这些行星之间修建了 n - 1 条星际航道,使得任意 ...

  3. interface Impl

    public interface ActionBarOperations { void initSthOne(); void initSthTwo(); } public class ActionBa ...

  4. 动态设置progressBar的进度

    progressDrawable = this.getResources().getDrawable(R.drawable.image); progressDrawable.setBounds(mSe ...

  5. DES加密解密 Java中运用

    DES全称Data Encryption Standard,是一种使用密匙加密的块算法.现在认为是一种不安全的加密算法,因为现在已经有用穷举法攻破DES密码的报道了.尽管如此,该加密算法还是运用非常普 ...

  6. 微信小程序 --- 登录页面

    思路:在个人中心页面,首先判断全局的 app.js 里面的 globalData 里面的 is_login 状态,并且判断 缓存数据中的 is_login 状态,如果都为真,就正常显示,如果有一个为假 ...

  7. BFS+状态压缩DP+二分枚举+TSP

    http://acm.hdu.edu.cn/showproblem.php?pid=3681 Prison Break Time Limit: 5000/2000 MS (Java/Others)   ...

  8. POM(project Object Model) Maven包管理依赖 pom.xml文件

    什么是POM POM全称为“Project Object Model”,意思是工程对象模型.Maven工程使用pom.xml来指定工程配置信息,和其他文本信息.该配置文件以xml为格式,使用xml语法 ...

  9. CommonHelper 公共类

      public static class CommonHelper 公共帮助类 using System.Collections.Generic; using System.Linq; using ...

  10. 删除Excel中的复选框等控件