diff --git a/src/lib/settings/ApplicationSettings.cpp b/src/lib/settings/ApplicationSettings.cpp index 7f11f583..eeca711c 100644 --- a/src/lib/settings/ApplicationSettings.cpp +++ b/src/lib/settings/ApplicationSettings.cpp @@ -385,16 +385,6 @@ void ApplicationSettings::setHasPrefilledJavaPath(bool v) setValue("indexing/java/has_prefilled_java_path", v); } -int ApplicationSettings::getJavaMaximumMemory() const -{ - return getValue("indexing/java/java_maximum_memory", -1); -} - -void ApplicationSettings::setJavaMaximumMemory(int size) -{ - setValue("indexing/java/java_maximum_memory", size); -} - std::vector ApplicationSettings::getJreSystemLibraryPaths() const { return getPathValues("indexing/java/jre_system_library_paths/jre_system_library_path"); diff --git a/src/lib/utility/commandline/commands/CommandlineCommandConfig.cpp b/src/lib/utility/commandline/commands/CommandlineCommandConfig.cpp index 702f96a7..9a463b14 100644 --- a/src/lib/utility/commandline/commands/CommandlineCommandConfig.cpp +++ b/src/lib/utility/commandline/commands/CommandlineCommandConfig.cpp @@ -107,8 +107,6 @@ void CommandlineCommandConfig::setup() "Enable additional log of abstract syntax tree during the indexing. WARNINIG Slows down " "indexing speed") ("jvm-path,j", po::value(), "Path to the location of the jvm library") - ("jvm-max-memory,M", po::value(), - "Set the maximum amount of memory for the JVM indexer(-1 for using the JVM default settings)") ("maven-path,m", po::value(), "Path to the maven binary") ("jre-system-library-paths,J", po::value>(), "paths to the jars of the JRE system library. " @@ -167,7 +165,6 @@ CommandlineCommand::ReturnStatus CommandlineCommandConfig::parse(std::vectorgetLoggingEnabled() << "\n verbose-indexer-logging-enabled: " << settings->getVerboseIndexerLoggingEnabled() << "\n jvm-path: " << settings->getJavaPath().str() - << "\n jvm-max-memory: " << settings->getJavaMaximumMemory() << "\n maven-path: " << settings->getMavenPath().str(); printVector("global-header-search-paths", settings->getHeaderSearchPaths()); printVector("global-framework-search-paths", settings->getFrameworkSearchPaths()); @@ -185,7 +182,6 @@ CommandlineCommand::ReturnStatus CommandlineCommandConfig::parse(std::vectorSpecify the maximum amount of memory that will be allocated by the indexer's JVM (values are in MB). Set " - "this value to -1 to use the JVM's default setting.

" - "

Warning: You may experience a sudden slowdown during the course of indexing when setting this value " - "too low. This may also happen when using the JVM's default setting.

", - layout, row - ); - layout->setRowMinimumHeight(row - 1, 30); - } - else - { - m_jvmMaximumMemory = nullptr; - } - { // JRE System Library const QString title = "JRE System Library"; @@ -466,11 +448,6 @@ void QtProjectWizardContentPreferences::load() m_javaPath->setText(QString::fromStdWString(appSettings->getJavaPath().wstr())); } - if (m_jvmMaximumMemory) - { - m_jvmMaximumMemory->setText(QString::number(appSettings->getJavaMaximumMemory())); - } - m_jreSystemLibraryPaths->setPaths(appSettings->getJreSystemLibraryPaths()); if (m_mavenPath) @@ -535,15 +512,6 @@ void QtProjectWizardContentPreferences::save() appSettings->setJreSystemLibraryPaths(m_jreSystemLibraryPaths->getPathsAsAbsolute()); - if (m_jvmMaximumMemory) - { - const int jvmMaximumMemory = m_jvmMaximumMemory->text().toInt(); - if (jvmMaximumMemory) - { - appSettings->setJavaMaximumMemory(jvmMaximumMemory); - } - } - if (m_mavenPath) { appSettings->setMavenPath(FilePath(m_mavenPath->getText().toStdWString())); diff --git a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.h b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.h index d7ce1ae0..61b0a799 100644 --- a/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.h +++ b/src/lib_gui/qt/project_wizard/content/QtProjectWizardContentPreferences.h @@ -124,7 +124,6 @@ private: QComboBox* m_mavenPathDetectorBox; QtLocationPicker* m_javaPath; QtPathListBox* m_jreSystemLibraryPaths; - QLineEdit* m_jvmMaximumMemory; QtLocationPicker* m_mavenPath; QCheckBox* m_pythonPostProcessing; diff --git a/src/lib_java/data/parser/java/JavaEnvironmentFactory.cpp b/src/lib_java/data/parser/java/JavaEnvironmentFactory.cpp index 88101141..8e5a16ed 100644 --- a/src/lib_java/data/parser/java/JavaEnvironmentFactory.cpp +++ b/src/lib_java/data/parser/java/JavaEnvironmentFactory.cpp @@ -49,24 +49,7 @@ void JavaEnvironmentFactory::createInstance(std::string classPath, std::string& s_classPath = classPath; - int jvmMaximumMemory = ApplicationSettings::getInstance()->getJavaMaximumMemory(); - -#ifdef WIN32 - if (jvmMaximumMemory > 0) - { - const float underestimationFactor = 0.8f; - const int maximumMB = utility::getLargestByteSizeOfAllocatableMemory() / 1024 / 1024 * underestimationFactor; - if (jvmMaximumMemory > maximumMB) - { - LOG_WARNING("Selected amount of maximum JVM memory of " + std::to_string(jvmMaximumMemory) + " MB exceeds maximum allocatable " - "memory on system. Correcting selected value to " + std::to_string(maximumMB) + " MB."); - jvmMaximumMemory = maximumMB; - } - } -#endif // WIN32 - - const int optionCount = (jvmMaximumMemory < 0 ? 2 : 3); - const std::string maximumMemoryOprionString = "-Xmx" + std::to_string(jvmMaximumMemory) + "m"; + const int optionCount = 2; JavaVM* jvm = nullptr; // Pointer to the JVM (Java Virtual Machine) JNIEnv* env = nullptr; // Pointer to native interface @@ -84,10 +67,6 @@ void JavaEnvironmentFactory::createInstance(std::string classPath, std::string& //options[5].optionString = const_cast("-Dcom.sun.management.jmxremote.authenticate=false"); //options[6].optionString = const_cast("-Dcom.sun.management.jmxremote.ssl=false"); - if (optionCount == 3) - { - options[2].optionString = const_cast(maximumMemoryOprionString.c_str()); - } vm_args.version = JNI_VERSION_1_8; vm_args.nOptions = optionCount; vm_args.options = options;