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

AppContext.getProperty() uses poorly-scaling System.getProperty inside #1222

Closed
alexbudarov opened this issue Aug 29, 2018 · 2 comments
Closed
Assignees
Labels
state: fixed Fixed by the developer type: performance ver: 6.10.0 Fixed in version ver: 7.0.0 Fixed in version
Milestone

Comments

@alexbudarov
Copy link
Member

Environment

  • Platform version: 6.8.12

Description of the bug or enhancement

Have been performing performance testing with JVisualVM.
One of CPU profile method chains shows interesting info:
image

AppContext.getProperty() uses System.getProperty() inside.
But System.getProperty() is implemented via Hashtable class. Every get() call enters a global synchronized block and therefore is poorly scalable in multithread environment.

I think that all platform code assumes that AppContext.getProperty() is cheap and highly scalable. So depending on System.getProperty() is a problem.

@alexbudarov alexbudarov changed the title AppContext.getProperty() uses poorly-scalable System.getProperty inside AppContext.getProperty() uses poorly-scaling System.getProperty inside Aug 29, 2018
@knstvk knstvk added this to the Release 6.10 milestone Aug 29, 2018
@haulmont-git haulmont-git added the ver: 6.10.0 Fixed in version label Sep 21, 2018
@haulmont-git haulmont-git added the ver: 7.0.0 Fixed in version label Sep 21, 2018
@haulmont-git haulmont-git added the ver: 6.10.0 Fixed in version label Sep 21, 2018
@haulmont-git haulmont-git added the ver: 7.0.0 Fixed in version label Sep 21, 2018
@knstvk
Copy link
Member

knstvk commented Sep 21, 2018

Solution

System properties are read on startup and cached in a ConcurrentHashMap. Consequently, changes in system properties made at runtime do not affect the system. If you need to read the new value of a system property, reset the cache using the clearSystemPropertiesCache() methods of the CachingFacadeMBean JMX beans available in the core and web modules.

@knstvk knstvk assigned myatlevEvg and natfirst and unassigned myatlevEvg Sep 21, 2018
@knstvk
Copy link
Member

knstvk commented Sep 21, 2018

For manual testing: try to redefine an app property with a system property.

@IskandarovRost IskandarovRost added the state: fixed Fixed by the developer label Sep 23, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state: fixed Fixed by the developer type: performance ver: 6.10.0 Fixed in version ver: 7.0.0 Fixed in version
Projects
None yet
Development

No branches or pull requests

6 participants