Revert "IDEA-290457 Enable NMT in mac launcher"

This reverts commit 0f63e55d250ad2394c895a72730e35127cfc8b8a.

IJ-CR-21984

GitOrigin-RevId: 081163f02a6d3619d9b4746bc79be90716bda8f2
This commit is contained in:
Roman Shevchenko
2022-05-09 11:21:21 +02:00
committed by intellij-monorepo-bot
parent 7f1d232083
commit 20f519215c

View File

@@ -428,21 +428,7 @@ NSString *getOverridePropertiesPath() {
if (vmOptions != nil) {
[args_array addObjectsFromArray:vmOptions];
}
//special case for NMT, logic is from java.c from openjdk
static const char* NMT_Env_Name = "NMT_LEVEL_";
for (NSString * arg in vmOptions)
{
if([arg hasPrefix:@"-XX:NativeMemoryTracking="]) {
// get what follows this parameter, include "=", limited to 10 characters
NSString * value = [arg substringFromIndex:strlen("-XX:NativeMemoryTracking=")];
if (value.length > 10) value = [value substringToIndex:10];
int pid = [[NSProcessInfo processInfo] processIdentifier];
NSString * envName = [NSString stringWithFormat:@"%s%d", NMT_Env_Name, pid];
setenv([envName UTF8String], [value UTF8String], 1);
}
}
NSString *properties = getOverridePropertiesPath();
if (properties != nil) {
[args_array addObject:[NSString stringWithFormat:@"-Didea.properties.file=%@", properties]];