简体   繁体   English

如何解决问题“Java 实例占用了我所有的内存”

[英]How to resolve issue "Java instances eating up all my memory"

I upgraded my Android Studio from 4.0 to 4.1 a few weeks ago and since then I am facing this issue that there are a number of instances of Java running.几周前,我将我的Android Studio从 4.0 升级到 4.1,从那以后我遇到了这个问题,即有许多Java实例正在运行。 Attaching snapshot for reference.附上快照以供参考。 在此处输入图像描述

You can see that there are a number of Java instances under Android Studio and almost equal instances are outside of Android Studio as standalone instances.您可以看到Android Studio下有许多Java实例,几乎相等的实例在Android Studio之外作为独立实例。
I have followed some threads related to this issue and performed:我已经关注了一些与此问题相关的线程并执行了:

  1. Java Cache Cleanup Java 缓存清理
  2. Uninstall and reinstall Java卸载重装Java
  3. Restart System重启系统

After restarting system it works normally for sometime or for a day then I face the same problem again.重新启动系统后,它可以正常工作一段时间或一天,然后我又遇到了同样的问题。 Please let me know what I have to do to overcome this problem.请让我知道我必须做些什么来克服这个问题。 After this much memory consumption Android Studio does not run the code saying there is not enough memory, So it wastes a lot of time.经过这么多memory消耗Android Studio没有运行代码说memory不够,所以浪费了很多时间。

I'm using我在用着

  • Windows 10 - 64-bit Windows 10 - 64 位
  • Java 8 update 281 - 64-bit Java 8 更新 281 - 64 位
  • Android Studio 4.1 Android Studio 4.1
  • 16 GB RAM 16 GB 内存

You can adjust JVM options with org.gradle.jvmargs at gradle.properties file.您可以使用gradle.properties文件中的gradle.properties调整 JVM 选项。 For example org.gradle.jvmargs=-Xmx1536M -Dkotlin.daemon.jvm.options\="-Xmx1536M"例如org.gradle.jvmargs=-Xmx1536M -Dkotlin.daemon.jvm.options\="-Xmx1536M"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM