You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by li...@apache.org on 2023/02/27 08:26:26 UTC

[tomcat] branch main updated: Fix a bug that memory allocation is larger than limit in SynchronizedStack to reduce memory footprint.

This is an automated email from the ASF dual-hosted git repository.

lihan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/main by this push:
     new 012f619108 Fix a bug that memory allocation is larger than limit in SynchronizedStack to reduce memory footprint.
012f619108 is described below

commit 012f61910889dee66c6d50d732fab9bb1d666609
Author: lihan <li...@apache.org>
AuthorDate: Mon Feb 27 16:25:42 2023 +0800

    Fix a bug that memory allocation is larger than limit in SynchronizedStack to reduce memory footprint.
---
 java/org/apache/tomcat/util/collections/SynchronizedStack.java | 2 +-
 webapps/docs/changelog.xml                                     | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/tomcat/util/collections/SynchronizedStack.java b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
index f178b02048..526c44cef5 100644
--- a/java/org/apache/tomcat/util/collections/SynchronizedStack.java
+++ b/java/org/apache/tomcat/util/collections/SynchronizedStack.java
@@ -52,7 +52,7 @@ public class SynchronizedStack<T> {
             this.size = size;
         }
         this.limit = limit;
-        stack = new Object[size];
+        stack = new Object[this.size];
     }
 
 
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index e7eb32f1dd..eeb833999e 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -105,6 +105,14 @@
   issues do not "pop up" wrt. others).
 -->
 <section name="Tomcat 11.0.0-M4 (markt)" rtext="in development">
+  <subsection name="General">
+    <changelog>
+      <fix>
+        Fix a bug that memory allocation is larger than limit in
+        <code>SynchronizedStack</code> to reduce memory footprint. (lihan)
+      </fix>
+    </changelog>
+  </subsection>
   <subsection name="Catalina">
     <changelog>
       <add>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org