https://bz.apache.org/bugzilla/show_bug.cgi?id=59882

            Bug ID: 59882
           Summary: JMeter memory allocations reduction
           Product: JMeter
           Version: 3.0
          Hardware: HP
                OS: Neutrino
            Status: NEW
          Severity: enhancement
          Priority: P2
         Component: Main
          Assignee: [email protected]
          Reporter: [email protected]

I've been profiling jmeter memory allocation under different conditions
the PR linked to this bug gives substantial improvements.

Gain really depends on the test but in the worst case (compressed content, no
embedded resources) it's about 15% less allocations (in bytes)
When not compressed (no embedded resources) and if content-length is sent by
the server my test gives 30% reduction in bytes allocated
As always YMMV but this PR is always a win in all my different tests.

Reduction in memory allocated comes from
Better usage of ByteArrayOutputStream  by
  - directly accessing the buffer instead of copying it
  - or by using the commons-lang implementation which avoid copying memory
around when extending the buffer
  - or by creating the string directly from the buffer instead of a temporary
copy

Avoid unneeded string concatenation due to missing log.isDebugEnabled()
if possible use httpclient CharArrayBuffer to avoid memory allocations
Do not create unneeded silent exceptions
Do not allocate 2 empty iterators on each call to executeSamplePackage
  - LinkedList.iterator() is a stinky monkey. Also see HTTPCORE-361
Set better default size to StringBuilder buffers
improve JOrphanUtils#replaceAllChars : provides a fast path which does not
allocate memory
etc..

Remark : 
When using ssl, jsse is a major source of unneeded allocation !!!! 
(sun.security.ssl.SSLContextImpl#getDefaultCipherSuiteList(boolean))
https://bugs.openjdk.java.net/browse/JDK-8133070 should improve the situation
(I did not test it)
the title of the bug is misleading as it's also about an internal cache beeing
cleared on each method call.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to