Increase file size limit in Pycharm 2018.3 in MacOS

Increase file size limit in Pycharm 2018.3 in MacOS

By default Pycharm has maximum file size limit set to few megabytes. When trying to open file bigger than the allowed size only part of file is opened and warning message appears: “The file size (16.1 MB) exceeds configured limit (2.56 MB). Code insight features are not available”

To allow large file size open there is needed to make configuration changes.

Go to menu and click Help -> Edit custom properties, then the file idea.properties are created and is ready to add configuration:

# custom PyCharm properties

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE should provide code assistance for.
# The larger file is the slower its editor works and higher overall
# system memory requirements are
# if code assistance is enabled. Remove this property or set to very
# large number if you need
# code assistance for any files available regardless their size.
#---------------------------------------------------------------------
idea.max.intellisense.filesize=40000

#---------------------------------------------------------------------
# Maximum file size (kilobytes) IDE is able to open.
#---------------------------------------------------------------------
idea.max.content.load.filesize=40000

When opening large files a lot of memory is consumed and also there is needed to increase Pycharm java memory. In MacOS go to the following location: ~/Library/Preferences/PyCharm2018.3 and edit file pycharm.vmoptions by changing Xmx value like in the example below:

$ cat pycharm.vmoptions 
-Xms128m
-Xmx3000m
-XX:ReservedCodeCacheSize=240m
-XX:+UseCompressedOops
-Dfile.encoding=UTF-8
-XX:+UseConcMarkSweepGC
-XX:SoftRefLRUPolicyMSPerMB=50
-ea
-Dsun.io.useCanonCaches=false
-Djava.net.preferIPv4Stack=true
-Djdk.http.auth.tunneling.disabledSchemes=""
-XX:+HeapDumpOnOutOfMemoryError
-XX:-OmitStackTraceInFastThrow
-Xverify:none

-XX:ErrorFile=$USER_HOME/java_error_in_pycharm_{fbe7e1720ad53e6bcb3f2cf6702a9bb526c4761d338b3c5bb5792632eb918792}p.log
-XX:HeapDumpPath=$USER_HOME/java_error_in_pycharm.hprof

At the end restart Pycharm and now large files like 39 MB maximum can be opened.

Leave a Reply