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

Excessive memory allocation #18

Open
ralf0131 opened this issue Mar 25, 2019 · 1 comment
Open

Excessive memory allocation #18

ralf0131 opened this issue Mar 25, 2019 · 1 comment

Comments

@ralf0131
Copy link
Collaborator

The following flame graph shows the memory allocation is beyond expectation. We should optimize it.

image

@ralf0131
Copy link
Collaborator Author

This should be fixed previously. The major allocation comes from com.alibaba.metrics.common.filter.MetricNameSetFilter#matches. To avoid string allocation, using the following logic instead.

success = name.getKey().startsWith(nameToMatch) && nameToMatch.length() == lastIndexOfDot;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant