0

I noticed that my Ubuntu 20.04 slows down and sometimes freezes when I open XML files in PyCharm.

After I open the 20MB XML file, it starts freezing and PyCharm says this:

11:33   Low memory
        The IDE is running low on memory and this might affect performance. Please consider increasing available heap.
        Analyze memory use   Configure

This is the configuration:

enter image description here

Should I increase the Heap Size? Even if it reached the Heap Size, why does everything freeze?

This is a memory analysis (I can't paste so much of text here):

https://gist.github.com/milano-slesarik/2970f95032d7e1937ce1340fc3b4db50

Milano
  • 18,048
  • 37
  • 153
  • 353
  • 1
    Yes, try increasing the IDE heap size as per https://intellij-support.jetbrains.com/hc/en-us/articles/206544869-Configuring-JVM-options-and-platform-properties . As for the freezes, I think it is expected because when the JVM process is close to reaching the heap size the GC (Garbage Collector) starts working extensively which may negatively affect the overall application performance. – Egor Klepikov Oct 05 '21 at 10:04
  • Please see [this answer](https://stackoverflow.com/a/52338020) for why the apparently small 20MB XML file expands so much in size when in memory. This can also depend on the specifics of your code (if the function is iterating or loading everything into memory in bulk). – bad_coder Oct 05 '21 at 11:10
  • @bad_coder I understand that the python objects could be much bigger but this is only about opening the file in PyCharm editor (I guess PyCharm also does some analysis so I expect the memory consumption to be bigger than 20MB). – Milano Oct 05 '21 at 11:26
  • @Milano if it's XML the IDE will start running indentation, syntax highlight, costum style rules associate with the file type, a proper parser, etc... – bad_coder Oct 05 '21 at 11:28

0 Answers0