Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OSMBean.getFreePhysicalMemorySize supression option #16039

Merged

Conversation

@pveentjer
Copy link
Member

pveentjer commented Nov 18, 2019

Adds option to disable the retrieval of this method.

We have one customer that runs in to multisecond execution times of the method when he runs under AIX.

@pveentjer pveentjer force-pushed the pveentjer:v4.0/fix/getFreePhysicalMemorySize branch from 0411d03 to a6d7a6e Nov 18, 2019
@pveentjer pveentjer changed the title WIP OSMBean.getFreePhysicalMemorySize supression option Nov 18, 2019
@pveentjer

This comment has been minimized.

Copy link
Member Author

pveentjer commented Nov 18, 2019

Ideally the code gets updated. I think the best approach would be to expand the OSMBeanSupport class so that all methods of the dynamically determined OSMBean are exposed directly. And reflection is done behind this class.

But that is going to be a large and risky change; main goal of this PR is to apply fix this on 4.0 and then to backport it to 3.12 and 3.11. And I want to do that with the least amount of change (lowest risk)

@blazember blazember self-requested a review Nov 18, 2019
@vbekiaris vbekiaris self-requested a review Nov 18, 2019
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertNotEquals;

public class OperatingSystemMXBeanSupport_FreePhysicalMemorySizeDisabledTest {

This comment has been minimized.

Copy link
@blazember

blazember Nov 18, 2019

Contributor

Needs

@RunWith(HazelcastSerialClassRunner.class)
@Category(QuickTest.class)

This comment has been minimized.

Copy link
@pveentjer

pveentjer Nov 18, 2019

Author Member

good point. Totally forgot about that.

@@ -73,7 +74,12 @@ public static void register(MetricsRegistry metricsRegistry) {
}

static void registerMethod(MetricsRegistry metricsRegistry, Object osBean, String methodName, String name) {
registerMethod(metricsRegistry, osBean, methodName, name, 1);
if (OperatingSystemMXBeanSupport.GET_FREE_PHYSICAL_MEMORY_SIZE_DISABLED
|| methodName.equals("getFreePhysicalMemorySize")) {

This comment has been minimized.

Copy link
@vbekiaris

vbekiaris Nov 19, 2019

Contributor

should read && instead of ||

This comment has been minimized.

Copy link
@pveentjer

pveentjer Nov 19, 2019

Author Member

very good spotting.

A flag is added to supress retrieving this value. On AIX there
is one customer that runs into multi seconds execution times
for this method.
@pveentjer pveentjer force-pushed the pveentjer:v4.0/fix/getFreePhysicalMemorySize branch from 81055f9 to 7a683c1 Nov 19, 2019
@pveentjer pveentjer merged commit 879cc29 into hazelcast:master Nov 19, 2019
1 check passed
1 check passed
default Test PASSed.
Details
@pveentjer pveentjer deleted the pveentjer:v4.0/fix/getFreePhysicalMemorySize branch Nov 20, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.