--- old/src/share/vm/prims/jvmtiEnv.cpp 2016-08-08 13:13:47.109648931 -0400 +++ new/src/share/vm/prims/jvmtiEnv.cpp 2016-08-08 13:13:45.760094662 -0400 @@ -3560,28 +3560,34 @@ JvmtiEnv::GetSystemProperties(jint* count_ptr, char*** property_ptr) { jvmtiError err = JVMTI_ERROR_NONE; - *count_ptr = Arguments::PropertyList_count(Arguments::system_properties()); + // Get the number of readable properties. + *count_ptr = Arguments::PropertyList_readable_count(Arguments::system_properties()); + // Allocate memory to hold the exact number of readable properties. err = allocate(*count_ptr * sizeof(char *), (unsigned char **)property_ptr); if (err != JVMTI_ERROR_NONE) { return err; } - int i = 0 ; - for (SystemProperty* p = Arguments::system_properties(); p != NULL && i < *count_ptr; p = p->next(), i++) { - const char *key = p->key(); - char **tmp_value = *property_ptr+i; - err = allocate((strlen(key)+1) * sizeof(char), (unsigned char**)tmp_value); - if (err == JVMTI_ERROR_NONE) { - strcpy(*tmp_value, key); - } else { - // clean up previously allocated memory. - for (int j=0; jnext()) { + if (p->is_readable()) { + const char *key = p->key(); + char **tmp_value = *property_ptr+readable_count++; + err = allocate((strlen(key)+1) * sizeof(char), (unsigned char**)tmp_value); + if (err == JVMTI_ERROR_NONE) { + strcpy(*tmp_value, key); + } else { + // clean up previously allocated memory. + for (int j=0; j