下面通过模拟实例分析排查Java应用程序CPU和内存占用过高的过程.如果是Java面试,这2个问题在面试过程中出现的概率很高,所以我打算在这里好好总结一下. 1.Java CPU过高的问题排查 举个例子,如下: package com.classloading; public class Test { static class MyThread extends Thread { public void run() { // 死循环,消耗CPU int i = 0; while (true) {…
using UnityEngine; using System.Diagnostics; using System.Text; using UnityEngine.UI; public class simpleTest : MonoBehaviour { System.TimeSpan t1; System.TimeSpan t2; /// <summary> /// Main()会被UNITY调用!,只要名字是Main(),不管是public, static, void, int /// 当…