IDEA优化配置,提高启动和运行速度

版权声明:本文为博主原创文章,遵循 CC 4.0 by-sa 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://blog.csdn.net/zwd926/article/details/85391332

IDEA优化配置,提高启动和运行速度

IDEA默认启动配置主要考虑低配置用户,参数不高,导致 启动慢,然后运行也不流畅,这里我们需要优化下启动和运行配置;

找到idea安装的bin目录;

D:\Program Files\JetBrains\IntelliJ IDEA 2017.2.3\bin

打开idea.exe.vmoptions 这个文件

关键的三个参数 

第一个 -Xms 是最小启动内存参数 

第二个 -Xmx 是最大运行内存参数

第三个-XX:ReservedCodeCacheSize  保留代码占用的内存容量参数

根据你的电脑配置,适当提高配置参数:我的电脑是16G内存 所以我的配置如下

然后保存配置 重新打开试试 是不是瞬间快了很多;

作为开发来说,电脑配置不能低,特别是项目在运行时,吃内存最厉害,硬盘也是一点,我的配置是普通的I5cpu,16G内存,120G固态+500G的机械,2G的独显。既然作为IT人,请不要对自己吃饭的家伙吝啬!!!

 

展开阅读全文

怎样优化sql的统计语句,提高运行速度

09-14

各位前辈,小弟菜鸟,写了一个小程序用来统计服务器上的关于4中消费数据,主要是统计各个类的消费每个月每天6:00-23:59各个时段的消费次数,然后写入到本地Access数据库,主要代码如下:rn[code=C#]rncase "01":rn case "03":rn case "05":rn case "07":rn case "08":rn case "10":rn case "12":rn for (int d = 1; d <= 31; d++)rn rn date = txtyear.Text + "-" + cobMonth.Text + "-" + d.ToString();rn for (int t = 6; t <= 23; t++)rn rnrn string QueryCT1 = "SELECT Count(*) FROM EM_RecBuf WHERE rectype = '1'AND ( Tdatetime BETWEEN '" + date + " " + t.ToString() + ":00:00' AND '" + date + " " + t.ToString() + ":59:59')";rn string QueryCT2 = "SELECT Count(*) FROM EM_RecBuf WHERE rectype = '2'AND ( Tdatetime BETWEEN '" + date + " " + t.ToString() + ":00:00' AND '" + date + " " + t.ToString() + ":59:59')";rn string QueryCT3 = "SELECT Count(*) FROM EM_RecBuf WHERE rectype = '3'AND ( Tdatetime BETWEEN '" + date + " " + t.ToString() + ":00:00' AND '" + date + " " + t.ToString() + ":59:59')";rn string QueryCT4 = "SELECT Count(*) FROM EM_RecBuf WHERE rectype = '4'AND ( Tdatetime BETWEEN '" + date + " " + t.ToString() + ":00:00' AND '" + date + " " + t.ToString() + ":59:59')";rn //string QueryCBS = "SELECT Sum(balance) FROM EM_RecBuf WHERE ( Tdatetime BETWEEN '" + date + " " + t.ToString() + ":00:00' AND '" + date + " " + t.ToString() + ":59:59')";rnrn SqlCommand sqlcmd1 = new SqlCommand(QueryCT1, conn);rn cct1 = int.Parse(sqlcmd1.ExecuteScalar().ToString());rnrn SqlCommand sqlcmd2 = new SqlCommand(QueryCT2, conn);rn cct2 = int.Parse(sqlcmd2.ExecuteScalar().ToString());rnrn SqlCommand sqlcmd3 = new SqlCommand(QueryCT3, conn);rn cct3 = int.Parse(sqlcmd3.ExecuteScalar().ToString());rnrn SqlCommand sqlcmd4 = new SqlCommand(QueryCT4, conn);rn cct4 = int.Parse(sqlcmd4.ExecuteScalar().ToString());rnrn ccs = cct1 + cct2 + cct3 + cct4;rnrn //SqlCommand sqlcmdCBS = new SqlCommand(QueryCBS, conn);rn //cbs = sqlcmdCBS.ExecuteScalar().ToString();rnrn string time = t.ToString();rn //写入本地数据库rn SaveTolocal(date,time,cct1,cct2,cct3,cct4,ccs);rnrn rn ;rn break;rn[/code]rn问题:rn1、用循环统计一个月500多条记录,居然要花10多分钟,sql server的CPU占用率达90%,怎样优化统计4种“类别”(1.2.3.4)同一时段的查询,我用了4调rn ( string QueryCT1 = "SELECT Count(*) FROM EM_RecBuf WHERE rectype = '1'AND ( Tdatetime BETWEEN '" + date + " " + t.ToString() + ":00:00' AND '" + date + " " + t.ToString() + ":59:59')";rn string QueryCT2 = "SELECT Count(*) FROM EM_RecBuf WHERE rectype = '2'AND ( Tdatetime BETWEEN '" + date + " " + t.ToString() + ":00:00' AND '" + date + " " + t.ToString() + ":59:59')";rn string QueryCT3 = "SELECT Count(*) FROM EM_RecBuf WHERE rectype = '3'AND ( Tdatetime BETWEEN '" + date + " " + t.ToString() + ":00:00' AND '" + date + " " + t.ToString() + ":59:59')";rn string QueryCT4 = "SELECT Count(*) FROM EM_RecBuf WHERE rectype = '4'AND ( Tdatetime BETWEEN '" + date + " " + t.ToString() + ":00:00' AND '" + date + " " + t.ToString() + ":59:59')";)rnrn2、//string QueryCBS = "SELECT Sum(balance) FROM EM_RecBuf WHERE ( Tdatetime BETWEEN '" + date + " " + t.ToString() + ":00:00' AND '" + date + " " + t.ToString() + ":59:59')";这一句什么地方有错,运行时总会出错,被我注释掉了!rnrn小弟这里先拜谢了! 论坛

没有更多推荐了,返回首页