Re: [OT] web app big memory usage?
Cris, On 6/3/21 12:25, Berneburg, Cris J. - US wrote: cb> StringBuilder - 264MB for the supporting byte array and 264MB for the cb> returned String, about 790MB total for that piece of the pie. cb> Contents were simply the JSON query results returned to the client. cb> No mystery there. Also, I noticed that the SB internal memory usage is about 2x the size of the actual contents. Is that because each char is stored as 2 bytes for Unicode? (Not the char array to string conversion, which is different.) You'd have to look more closely at the circumstances. I was about to say that SB grows 2x each time is grows, but it doesn't. CS> Yep: runaway string concatenation. This is a devolution of the CS> "Connector/J reads the whole result set into memory before CS> returning" thing I mentioned above. Most JSON endpoints CS> return arbitrarily large JSON responses and most client CS> applications just go "duh, read the JSON, then process it". CS> If your JSON is big, well, then you need a lot of memory to CS> store it all if that' who you do things. Looking at the contents of the JSON, it's not normalized - a lot of redundant metadata. Hand-editing the JSON for analysis reduced it from 135 MB to 26 MB. Maybe the code that generates it can be improved. Wow, that's quite an improvement. CS> If you want to deal with JSON at scale, you need to process CS> it in a streaming fashion. The only library I know that can do CS> streaming JSON is Noggit, which was developed for use with CS> Solr (I think, maybe it came from elsewhere before that). CS> Anyway, it's ... not for the faint of heart. But if you can figure CS> out out, you can handle petabytes of JSON with a tiny heap. I don't think we need to serve up that much data, but I'm guessing we can do better with what we do serve. Interesting nonetheless. CS> You might want to throttle/serialize queries you expect to CS> have big responses so that only e.g. 2 of them can be running CS> at a time. Maybe all is well when they come one-at-a-time, CS> but if you try to handle 5 concurrent "big responses" you bust CS> your heap. Hmm... I had not thought of throttling that way, restricting the number of concurrent queries. I was thinking about restricting the number of records returned. Not sure how to handle lots of users connected but only a few able to query concurrently. Different DB connection pool with fewer connections for queries? I think it will be easier for you to restrict the total number of connections via your pool than to change your application to e.g. page the data, or request smaller chunks, or whatever. As long as the queries don't take a long time to execute and, once they are processed, the data are quickly discarded, I think you'll stabalize your application. I think users would prefer slow and reliable over fast and sometimes unavailable due to OOME :) -chris - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [OT] web app big memory usage?
Thanks Chris [snip, snip, snippety-snip] CS> What's the database? And the driver? Oracle 19, oracle.jdbc.OracleDriver - jdbc:oracle:thin. CS> MySQL Connector/J used to (still does?) read 100% of the results CS> into the heap before Statement.executeQuery() returns unless you CS> specifically tell it not to. So if your query returns 1M rows, you CS> might bust your heap. CS> It's entirely possible that other drivers do similar things. The JSON has all the rows, so it appears no pagination is being used on the DB level. cb> Multiple TC instances cb> (3) because multiple copies of the apps don't play nice with each cb> other. That is, we can't just rename the WAR files and expect the cb> deployed apps to stay inside that context name (I think). CS> You might want to look into that, eventually. If they aren't playing CS> together nicely, they are not "good" servlet citizens. Solving those CS> issues may improve other things. *shrug* Yeah, I was working on that previously, but attention spans are short, and I got pulled off that task onto - SQUIRREL! cb> StringBuilder - 264MB for the supporting byte array and 264MB for the cb> returned String, about 790MB total for that piece of the pie. cb> Contents were simply the JSON query results returned to the client. cb> No mystery there. Also, I noticed that the SB internal memory usage is about 2x the size of the actual contents. Is that because each char is stored as 2 bytes for Unicode? (Not the char array to string conversion, which is different.) CS> Yep: runaway string concatenation. This is a devolution of the CS> "Connector/J reads the whole result set into memory before CS> returning" thing I mentioned above. Most JSON endpoints CS> return arbitrarily large JSON responses and most client CS> applications just go "duh, read the JSON, then process it". CS> If your JSON is big, well, then you need a lot of memory to CS> store it all if that' who you do things. Looking at the contents of the JSON, it's not normalized - a lot of redundant metadata. Hand-editing the JSON for analysis reduced it from 135 MB to 26 MB. Maybe the code that generates it can be improved. CS> If you want to deal with JSON at scale, you need to process CS> it in a streaming fashion. The only library I know that can do CS> streaming JSON is Noggit, which was developed for use with CS> Solr (I think, maybe it came from elsewhere before that). CS> Anyway, it's ... not for the faint of heart. But if you can figure CS> out out, you can handle petabytes of JSON with a tiny heap. I don't think we need to serve up that much data, but I'm guessing we can do better with what we do serve. Interesting nonetheless. CS> You might want to throttle/serialize queries you expect to CS> have big responses so that only e.g. 2 of them can be running CS> at a time. Maybe all is well when they come one-at-a-time, CS> but if you try to handle 5 concurrent "big responses" you bust CS> your heap. Hmm... I had not thought of throttling that way, restricting the number of concurrent queries. I was thinking about restricting the number of records returned. Not sure how to handle lots of users connected but only a few able to query concurrently. Different DB connection pool with fewer connections for queries? cb> (At least StringBuilder is being cb> used instead of plus-sign String concatenation.) CS> In Java "..." + "..." uses a StringBuilder I did not know that. Or I forgot, in which case I can't tell the diff. :-P CS> In some code, "..." + "..." is just fine Often it's run-on sentences of plus-sign concatenation with nested quotes, almost unreadable and even worse for editing. I like to replace with SB for readability and maintainability. CS> I hate it when someone replaces it with: CS> String foo = new StringBuilder("bar").append("baz").toString(); CS> because the compiler does the _exact same thing_ and you've CS> just made the code more difficult to read. Ahhh, the classic train wreck. :-) CS> in a *loop*, then replacing it with a StringBuilder is pretty CS> important for performance, otherwise the compiler will CS> do something stupid I believe the technical term for that is "stoopid". :-) Yeah, I like to be strategic about SB's and loops. CS> You might actually have to start reading some code (shiver!). "You're ... mocking me." :-) Actually, I might be able to pass it off onto the guy who wrote the library. *phew* -- Cris Berneburg CACI Senior Software Engineer This electronic message contains information from CACI International Inc or subsidiary companies, which may be company
Re: [OT] web app big memory usage?
Cris, On 6/1/21 09:17, Berneburg, Cris J. - US wrote: Hi Chris [lots of snippage] cb> One of our web apps is using a "lot" of memory, specifically a big cb> user query. We'd like to find out why. cb> 1. Is there a way to analyze uncollected garbage? cb> * AWS EC2 instance. cb> * There are other TC instances on the same server. cb> * Each TC instance has multiple apps. cs> What's the goal? Do you just Want To Know, or are you trying cs> to solve an actual problem. a. Barely enough memory to distribute among the multiple TC instances and the apps they support. A big enough user query (no throttling) causes OOME's. Attempting to determine if the code is being wasteful in some way and therefore could be made more efficient. What's the database? And the driver? MySQL Connector/J used to (still does?) read 100% of the results into the heap before Statement.executeQuery() returns unless you specifically tell it not to. So if your query returns 1M rows, you might bust your heap. It's entirely possible that other drivers do similar things. b. It's a dev app server (EC2) which hosts diff stages in the dev process - dev, test, and prototype streams. Multiple TC instances (3) because multiple copies of the apps don't play nice with each other. That is, we can't just rename the WAR files and expect the deployed apps to stay inside that context name (I think). You might want to look into that, eventually. If they aren't playing together nicely, they are not "good" servlet citizens. Solving those issues may improve other things. *shrug* c. I don't want to debug the code. I'm relatively new to the project, unfamiliar with some of the code, and anticipate getting lost in the weeds. See point #1 below. ;-) > cs> If you have a bunch of garbage that's not being cleaned up, cs> usually it's because there is simply no need to do so. The GC cs> is behaving according to the 3 laws of rob..., er, 3 virtues of cs> computing[1]: cs> cs>1. Laziness: nothing needs that memory so... meh cs>2. Impatience: gotta clean that Eden space quick cs>3. Hubris: if I ever need more memory, I know where to find it cs> [1] http://threevirtues.com/ Ha ha ha! :-) cs> How long does the query take to run? Dunno about the time on the DB query itself. From the user's point of view, a full minute plus. cs> What kind of query is it? Are we talking about something like SQL Yup. Classic RDMS back-end. cs> or some in-memory database or something which really does cs> take a lot of memory for the application to fulfill the request? Nah, nothing that fancy. The only fancy part is using node.js for the front-end. I followed Amit's and John's suggestion of using Eclipse Memory Analyzer Tool's "Keep unreachable options" when running a query from the app client. Digging deeper into the Leak Suspects Report, I saw a StringBuilder - 264MB for the supporting byte array and 264MB for the returned String, about 790MB total for that piece of the pie. Contents were simply the JSON query results returned to the client. No mystery there. Yep: runaway string concatenation. This is a devolution of the "Connector/J reads the whole result set into memory before returning" thing I mentioned above. Most JSON endpoints return arbitrarily large JSON responses and most client applications just go "duh, read the JSON, then process it". If your JSON is big, well, then you need a lot of memory to store it all if that' who you do things. If you want to deal with JSON at scale, you need to process it in a streaming fashion. The only library I know that can do streaming JSON is Noggit, which was developed for use with Solr (I think, maybe it came from elsewhere before that). Anyway, it's ... not for the faint of heart. But if you can figure out out, you can handle petabytes of JSON with a tiny heap. I suspect that repeating the process with multiple queries will reveal multiple StringBuilder's each containing big honking JSON results. Very likely. You might want to throttle/serialize queries you expect to have big responses so that only e.g. 2 of them can be running at a time. Maybe all is well when they come one-at-a-time, but if you try to handle 5 concurrent "big responses" you bust your heap. The short-term solution is to simply not allow that much concurrency. So the issue may not be a problem with efficiency so much as one of simple memory hogging. This can happen with almost any application. We serve ... many clients simultaneously and we run with a maximum of 10 connections in our db connection pool on each app server. It sounds "too small" but it handles the user-traffic without any user complaints. (At least StringBuilder is being used instead of plus-sign String concatenation.) In Java "..." + "..." uses a StringBuilder (unless the compiler can perform the concatenation at compile-time, in which case there is no concatenation at all). In some code, "..." + "..." is just fine and I hate i
RE: [OT] web app big memory usage?
Hi Chris [lots of snippage] cb> One of our web apps is using a "lot" of memory, specifically a big cb> user query. We'd like to find out why. cb> 1. Is there a way to analyze uncollected garbage? cb> * AWS EC2 instance. cb> * There are other TC instances on the same server. cb> * Each TC instance has multiple apps. cs> What's the goal? Do you just Want To Know, or are you trying cs> to solve an actual problem. a. Barely enough memory to distribute among the multiple TC instances and the apps they support. A big enough user query (no throttling) causes OOME's. Attempting to determine if the code is being wasteful in some way and therefore could be made more efficient. b. It's a dev app server (EC2) which hosts diff stages in the dev process - dev, test, and prototype streams. Multiple TC instances (3) because multiple copies of the apps don't play nice with each other. That is, we can't just rename the WAR files and expect the deployed apps to stay inside that context name (I think). c. I don't want to debug the code. I'm relatively new to the project, unfamiliar with some of the code, and anticipate getting lost in the weeds. See point #1 below. ;-) cs> If you have a bunch of garbage that's not being cleaned up, cs> usually it's because there is simply no need to do so. The GC cs> is behaving according to the 3 laws of rob..., er, 3 virtues of cs> computing[1]: cs> cs>1. Laziness: nothing needs that memory so... meh cs>2. Impatience: gotta clean that Eden space quick cs>3. Hubris: if I ever need more memory, I know where to find it cs> [1] http://threevirtues.com/ Ha ha ha! :-) cs> How long does the query take to run? Dunno about the time on the DB query itself. From the user's point of view, a full minute plus. cs> What kind of query is it? Are we talking about something like SQL Yup. Classic RDMS back-end. cs> or some in-memory database or something which really does cs> take a lot of memory for the application to fulfill the request? Nah, nothing that fancy. The only fancy part is using node.js for the front-end. I followed Amit's and John's suggestion of using Eclipse Memory Analyzer Tool's "Keep unreachable options" when running a query from the app client. Digging deeper into the Leak Suspects Report, I saw a StringBuilder - 264MB for the supporting byte array and 264MB for the returned String, about 790MB total for that piece of the pie. Contents were simply the JSON query results returned to the client. No mystery there. I suspect that repeating the process with multiple queries will reveal multiple StringBuilder's each containing big honking JSON results. So the issue may not be a problem with efficiency so much as one of simple memory hogging. (At least StringBuilder is being used instead of plus-sign String concatenation.) -- Cris Berneburg CACI Senior Software Engineer This electronic message contains information from CACI International Inc or subsidiary companies, which may be company sensitive, proprietary, privileged or otherwise protected from disclosure. The information is intended to be used solely by the recipient(s) named above. If you are not an intended recipient, be aware that any review, disclosure, copying, distribution or use of this transmission or its contents is prohibited. If you have received this transmission in error, please notify the sender immediately.
RE: [OT] web app big memory usage?
Hi Raghunath cb> One of our web apps is using a "lot" of memory, cb> specifically a big user query. We'd like to find out why. cb> 1. Is there a way to analyze uncollected garbage? rm> You could try using the Oracle utility - "jstat" - for analyzing rm> the GC in an active Java process (PID) rm> The "gcold" option helps us to peep into the Old Generation area rm> jstat -gcold PID rm> jstat -gcoldcapacity PID rm> rm> https://docs.oracle.com/javase/8/docs/technotes/tools/unix/jstat.html That sounds interesting. :-) I'll look into it! -- Cris Berneburg CACI Senior Software Engineer This electronic message contains information from CACI International Inc or subsidiary companies, which may be company sensitive, proprietary, privileged or otherwise protected from disclosure. The information is intended to be used solely by the recipient(s) named above. If you are not an intended recipient, be aware that any review, disclosure, copying, distribution or use of this transmission or its contents is prohibited. If you have received this transmission in error, please notify the sender immediately. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [OT] web app big memory usage?
Hi John :-) cb> 1. Is there a way to analyze uncollected garbage? cb> 2. Is that a reasonable way to identify potential memory usage problems? jeg> MAT has an option to "Keep unreachable options." It's under preferences. Thanks for the suggestion! I did not know about that option. jeg> It sounds like you don't have an actual leak, just high allocation/GC. Yeah, that's what I think too. jeg> My favorite tool for this is to use the Java Flight Recorder and analyze it with Java Mission Control. Hmm... Sounds interesting. I'll check it out! -- Cris Berneburg CACI Senior Software Engineer This electronic message contains information from CACI International Inc or subsidiary companies, which may be company sensitive, proprietary, privileged or otherwise protected from disclosure. The information is intended to be used solely by the recipient(s) named above. If you are not an intended recipient, be aware that any review, disclosure, copying, distribution or use of this transmission or its contents is prohibited. If you have received this transmission in error, please notify the sender immediately. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [OT] web app big memory usage?
Hi Amit :-) cb> 1. Is there a way to analyze uncollected garbage? cb> 2. Is that a reasonable way to identify potential memory usage problems? ap> Have you enabled the " Enable 'keep unreachable objects'" setting of MAT? ap> https://blog.gceasy.io/2015/12/11/eclipse-mat-titbits/ No, I had not heard of that before. Thanks for the suggestion! -- Cris Berneburg CACI Senior Software Engineer This electronic message contains information from CACI International Inc or subsidiary companies, which may be company sensitive, proprietary, privileged or otherwise protected from disclosure. The information is intended to be used solely by the recipient(s) named above. If you are not an intended recipient, be aware that any review, disclosure, copying, distribution or use of this transmission or its contents is prohibited. If you have received this transmission in error, please notify the sender immediately. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [OT] web app big memory usage?
You could try using the Oracle utility - "jstat" - for analyzing the GC in an active Java process (PID) The "gcold" option helps us to peep into the Old Generation area jstat -gcold PID jstat -gcoldcapacity PID https://docs.oracle.com/javase/8/docs/technotes/tools/unix/jstat.html -Original Message- From: Berneburg, Cris J. - US Sent: Thursday, May 27, 2021 1:24 PM To: users@tomcat.apache.org Subject: [OT] web app big memory usage? Hi Folks :-) One of our web apps is using a "lot" of memory, specifically a big user query. We'd like to find out why. The Tomcat Web Application Manager Find leaks button said that "No web applications appear to have triggered a memory leak on stop, reload or undeploy." Tomcat Manager Server Status shows that 1.7GB (82%) of G1 Old Gen space is being used that has not been recycled yet. I grabbed a heap dump and used Eclipse Memory Analyzer, and it shows that only 94MB of memory is being used when G1 Old Gen space used 1.8GB. MAT seems to be looking only at the active objects, not the discarded ones. IOW, we're looking at what the app is doing ATM, not what it already did. I want to explore the 1.7GB garbage pile to see what's being thrown away, not what things are still being used, to determine wastefulness. 1. Is there a way to analyze uncollected garbage? 2. Is that a reasonable way to identify potential memory usage problems? Some technical specifics: * TC 8.5.63 * Java 1.8.0_291 * AWS EC2 instance. * Windows Server 2016. * Instance started as Windows Service. * There are other TC instances on the same server. * Each TC instance has multiple apps. Thanks for reading this far. :-) -- Cris Berneburg CACI Senior Software Engineer This electronic message contains information from CACI International Inc or subsidiary companies, which may be company sensitive, proprietary, privileged or otherwise protected from disclosure. The information is intended to be used solely by the recipient(s) named above. If you are not an intended recipient, be aware that any review, disclosure, copying, distribution or use of this transmission or its contents is prohibited. If you have received this transmission in error, please notify the sender immediately. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: [OT] web app big memory usage?
Cris, On 5/27/21 15:24, Berneburg, Cris J. - US wrote: Hi Folks :-) One of our web apps is using a "lot" of memory, specifically a big user query. We'd like to find out why. The Tomcat Web Application Manager Find leaks button said that "No web applications appear to have triggered a memory leak on stop, reload or undeploy." Tomcat Manager Server Status shows that 1.7GB (82%) of G1 Old Gen space is being used that has not been recycled yet. I grabbed a heap dump and used Eclipse Memory Analyzer, and it shows that only 94MB of memory is being used when G1 Old Gen space used 1.8GB. MAT seems to be looking only at the active objects, not the discarded ones. IOW, we're looking at what the app is doing ATM, not what it already did. I want to explore the 1.7GB garbage pile to see what's being thrown away, not what things are still being used, to determine wastefulness. 1. Is there a way to analyze uncollected garbage? 2. Is that a reasonable way to identify potential memory usage problems? Some technical specifics: * TC 8.5.63 * Java 1.8.0_291 * AWS EC2 instance. * Windows Server 2016. * Instance started as Windows Service. * There are other TC instances on the same server. * Each TC instance has multiple apps. Thanks for reading this far. :-) What's the goal? Do you just Want To Know, or are you trying to solve an actual problem. If you have a bunch of garbage that's not being cleaned up, usually it's because there is simply no need to do so. The GC is behaving according to the 3 laws of rob..., er, 3 virtues of computing[1]: 1. Laziness: nothing needs that memory so... meh 2. Impatience: gotta clean that Eden space quick 3. Hubris: if I ever need more memory, I know where to find it Seriously, though, the only real difference between the new gen and the old gen is time, so if your query ran faster it might get a lot more of its scratch objects cleaner-up without having to ask for a full GC. How long does the query take to run? What kind of query is it? Are we talking about something like SQL or some in-memory database or something which really does take a lot of memory for the application to fulfill the request? [1] http://threevirtues.com/ - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [OT] web app big memory usage?
Cris, > -Original Message- > From: Berneburg, Cris J. - US > Sent: Thursday, May 27, 2021 2:24 PM > To: users@tomcat.apache.org > Subject: [OT] web app big memory usage? > > Hi Folks :-) > > One of our web apps is using a "lot" of memory, specifically a big user query. > We'd like to find out why. > > The Tomcat Web Application Manager Find leaks button said that "No web > applications appear to have triggered a memory leak on stop, reload or > undeploy." > > Tomcat Manager Server Status shows that 1.7GB (82%) of G1 Old Gen space > is being used that has not been recycled yet. > > I grabbed a heap dump and used Eclipse Memory Analyzer, and it shows that > only 94MB of memory is being used when G1 Old Gen space used 1.8GB. > MAT seems to be looking only at the active objects, not the discarded ones. > IOW, we're looking at what the app is doing ATM, not what it already did. > > I want to explore the 1.7GB garbage pile to see what's being thrown away, > not what things are still being used, to determine wastefulness. > > 1. Is there a way to analyze uncollected garbage? > > 2. Is that a reasonable way to identify potential memory usage problems? > > Some technical specifics: > * TC 8.5.63 > * Java 1.8.0_291 > * AWS EC2 instance. > * Windows Server 2016. > * Instance started as Windows Service. > * There are other TC instances on the same server. > * Each TC instance has multiple apps. > > Thanks for reading this far. :-) > > -- > Cris Berneburg > CACI Senior Software Engineer > > > > > This electronic message contains information from CACI International Inc or > subsidiary companies, which may be company sensitive, proprietary, > privileged or otherwise protected from disclosure. The information is > intended to be used solely by the recipient(s) named above. If you are not > an intended recipient, be aware that any review, disclosure, copying, > distribution or use of this transmission or its contents is prohibited. If you > have received this transmission in error, please notify the sender > immediately. > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org MAT has an option to "Keep unreachable options." It's under preferences. It sounds like you don't have an actual leak, just high allocation/GC. My favorite tool for this is to use the Java Flight Recorder and analyze it with Java Mission Control. John - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: [OT] web app big memory usage?
Have you enabled the " Enable 'keep unreachable objects'" setting of MAT? https://blog.gceasy.io/2015/12/11/eclipse-mat-titbits/ Thanks, Amit -Original Message- From: Berneburg, Cris J. - US Sent: Thursday, May 27, 2021 2:24 PM To: users@tomcat.apache.org Subject: [EXTERNAL] [OT] web app big memory usage? Hi Folks :-) One of our web apps is using a "lot" of memory, specifically a big user query. We'd like to find out why. The Tomcat Web Application Manager Find leaks button said that "No web applications appear to have triggered a memory leak on stop, reload or undeploy." Tomcat Manager Server Status shows that 1.7GB (82%) of G1 Old Gen space is being used that has not been recycled yet. I grabbed a heap dump and used Eclipse Memory Analyzer, and it shows that only 94MB of memory is being used when G1 Old Gen space used 1.8GB. MAT seems to be looking only at the active objects, not the discarded ones. IOW, we're looking at what the app is doing ATM, not what it already did. I want to explore the 1.7GB garbage pile to see what's being thrown away, not what things are still being used, to determine wastefulness. 1. Is there a way to analyze uncollected garbage? 2. Is that a reasonable way to identify potential memory usage problems? Some technical specifics: * TC 8.5.63 * Java 1.8.0_291 * AWS EC2 instance. * Windows Server 2016. * Instance started as Windows Service. * There are other TC instances on the same server. * Each TC instance has multiple apps. Thanks for reading this far. :-) -- Cris Berneburg CACI Senior Software Engineer This electronic message contains information from CACI International Inc or subsidiary companies, which may be company sensitive, proprietary, privileged or otherwise protected from disclosure. The information is intended to be used solely by the recipient(s) named above. If you are not an intended recipient, be aware that any review, disclosure, copying, distribution or use of this transmission or its contents is prohibited. If you have received this transmission in error, please notify the sender immediately. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
[OT] web app big memory usage?
Hi Folks :-) One of our web apps is using a "lot" of memory, specifically a big user query. We'd like to find out why. The Tomcat Web Application Manager Find leaks button said that "No web applications appear to have triggered a memory leak on stop, reload or undeploy." Tomcat Manager Server Status shows that 1.7GB (82%) of G1 Old Gen space is being used that has not been recycled yet. I grabbed a heap dump and used Eclipse Memory Analyzer, and it shows that only 94MB of memory is being used when G1 Old Gen space used 1.8GB. MAT seems to be looking only at the active objects, not the discarded ones. IOW, we're looking at what the app is doing ATM, not what it already did. I want to explore the 1.7GB garbage pile to see what's being thrown away, not what things are still being used, to determine wastefulness. 1. Is there a way to analyze uncollected garbage? 2. Is that a reasonable way to identify potential memory usage problems? Some technical specifics: * TC 8.5.63 * Java 1.8.0_291 * AWS EC2 instance. * Windows Server 2016. * Instance started as Windows Service. * There are other TC instances on the same server. * Each TC instance has multiple apps. Thanks for reading this far. :-) -- Cris Berneburg CACI Senior Software Engineer This electronic message contains information from CACI International Inc or subsidiary companies, which may be company sensitive, proprietary, privileged or otherwise protected from disclosure. The information is intended to be used solely by the recipient(s) named above. If you are not an intended recipient, be aware that any review, disclosure, copying, distribution or use of this transmission or its contents is prohibited. If you have received this transmission in error, please notify the sender immediately. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Memory Usage
On 24/04/2019 21:46, Simon Funnell wrote: > Hi, > > I am looking at running a small ecommerce site with about 40-80 users at a > time on a virtual private server with 4 cores and 1GB of memory, I am > planning on running apache james, mysql and tomcat on this instance. My > question is will 256MB maximum heap memory with say 50 threads be enough to > handle the load without any out of memory errors? No idea. I've seen apps with 6GB heap fail with OOME with only 5 concurrent users and other apps serve 1000s of users with a few hundred MB. It all depends on the app and we can't see you code. Load testing and profiling are strongly recommended. Mark - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Memory Usage
Hi, I am looking at running a small ecommerce site with about 40-80 users at a time on a virtual private server with 4 cores and 1GB of memory, I am planning on running apache james, mysql and tomcat on this instance. My question is will 256MB maximum heap memory with say 50 threads be enough to handle the load without any out of memory errors? Thanks.
Re: Memory usage increased form 500MB to 4 GB after changing the tomcat process from 32 bit to 64 bit execution
-BEGIN PGP SIGNED MESSAGE- Hash: SHA256 Nagendra, On 4/14/17 4:36 AM, nagendra.r...@wipro.com wrote: > Problem statement: Memory usage increased form 500MB to 4 GB after changing the tomcat process from 32 bit to 64 bit execution Any other changes? For example, changes to the heap configuration, stack configuration, or any other memory-related parameters? Please post your complete JVM launch command. If you use "catalina.sh" or "startup.sh" to launch Tomcat, use "ps" to find out the effective command and post that. How are you measuring the "memory usage"? > As tomcat memory has increased it is impacting available memory > for other applications on server > > o Is this a bug ? Almost certainly not. > o Earlier with 32bit it was running around 400MG, If we restrict > the tomcat memory to 500GB for 64bit application will it any > impact on tomcat operations You can only restrict the size of the various heaps. AFAIK, there is no way to restrict the amount of native memory that the JVM uses. > Tomcat Version : Tomcat 7.0.73 on Solaris 11 What JVM versions (32-bit and 64-bit)? - -chris -BEGIN PGP SIGNATURE- Comment: GPGTools - http://gpgtools.org Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBCAAGBQJY8QnDAAoJEBzwKT+lPKRYRQ0QAMc2mdwMwRmdp5Nh/9S7cVKW 2hSW3/v3nXcm0hWb6aq9e5UN9EqHQYZYIAu+Oil7aMwzQhS1blf4AZzcA/Zt1Mos scinD9dNSsoAF+hdVz0zxyF/u/PpKiIQPgVuRJb12gZzDqvYcYHAph4U5T7bi89Y eqKA+imc3ShWy3u4STDuu9RUEUqHuMUZ7efH8cDByUnwuHPDPYEdwcb5CWvimkWr E15Z9JGNsaluUZfC6hD8cFbVtegoPGIjYRKqRY0bRXshJkGlFITk/W4m5wMDTvW7 Or9THmCgtgIPkd+hdCjqlJ4kjOe5eEGhW1Lk6UsQSEOItTx23+hUYQf6q6f+Y/2o jWJoj/I2xo7pC3YptwK0eB3kI5ABaTfFOMJZ2IO0Dzp3QkVWg7nvLN2YFOG1P8Hz 6s82xP4GArx/nghaPK4IYwn3KaBbG4DHQWtND2w97PwcuE2x8qrnZce2LrQX/1lH vwzK6wqyDWJ/jlJeZm18u+nKT7cBLLcF+KJVhrjXAuDGtRYVzSA0aqqePLScQYp+ pk2H4Qhn9+HU0FTw7sXC1lSQXpwukdigeFc3qLPAb68gGBAWWa5ywVXOqQ45XHpE 43Pp1AmU3EcUgz40ZXHr0Exfoa8afDRzx4mVjP+FY4bpy1jA7hca7OGMI62eAL63 g8+unU7dnSD9VTy/S9/q =dmc3 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Memory usage increased form 500MB to 4 GB after changing the tomcat process from 32 bit to 64 bit execution
On 14.04.2017 10:36, nagendra.r...@wipro.com wrote: Hi All, Problem statement: Memory usage increased form 500MB to 4 GB after changing the tomcat process from 32 bit to 64 bit execution As tomcat memory has increased it is impacting available memory for other applications on server o Is this a bug ? o Earlier with 32bit it was running around 400MG, If we restrict the tomcat memory to 500GB for 64bit application will it any impact on tomcat operations Tomcat Version : Tomcat 7.0.73 on Solaris 11 Maybe as a very first observation : it is not Tomcat that you changed. The Tomcat code has remained exactly the same. It is the Java JVM that was changed, from a 32-bit to a 64-bit version. So /that/ is the underlying reason for the memory usage increase, not Tomcat. Read more on the topic : http://lmgtfy.com/?q=java+32-bit+vs+64-bit (I recommend this one as a starter : http://howtodoinjava.com/for-fun-only/difference-between-32-bit-java-vs-64-bit-java/) Thus, to respond to your first question : no, it is no a bug; or at least not a Tomcat bug. About your second question : there is no such thing as a 64-bit application under Tomcat. All Tomcat applications are written in Java, and are ultimately run by the Java JVM. It is the JVM which determines if this uses, for example, 32-bit or 64-bit memory pointers, 4-byte or 8-byte object references etc. If you reduce the available memory for the Tomcat Heap, then, depending on the way the applications are written, this may cause more Memory Garbage Collections to occur in any given period of time. Whether this really impacts your applications or not, is something which only you can measure and determine. Try it, and look at the results. Or add more memory to your server. If you went from a 32-bit JVM to a 64-bit JVM, presumably you had a reason for doing that. Wat was the reason ? (And if there was no good reason, you can always go back). - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Memory usage increased form 500MB to 4 GB after changing the tomcat process from 32 bit to 64 bit execution
Hi All, Problem statement: Memory usage increased form 500MB to 4 GB after changing the tomcat process from 32 bit to 64 bit execution As tomcat memory has increased it is impacting available memory for other applications on server o Is this a bug ? o Earlier with 32bit it was running around 400MG, If we restrict the tomcat memory to 500GB for 64bit application will it any impact on tomcat operations Tomcat Version : Tomcat 7.0.73 on Solaris 11 Thanks & Regards Nagendra Raju The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of this message and any attachments. WARNING: Computer viruses can be transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com
Re: Monitoring memory usage of JVM
Hi all, I don't know if this is useful but apart from utilities/commands already mentioned, I use the following to monitor the GC of the particular generations in JVM: /usr/jdk/jdk1.5.0_12/bin/jstat -gc $TOMCAT_PID 5000 10 Of course you need to substitute the appropriate JDK installed on your system and the time interval the stats should be printed. Cheers, Igor On Fri, May 27, 2011 at 6:07 PM, Mikolaj Rydzewski wrote: > On Fri, 27 May 2011 09:50:06 +0200, André Warnier wrote: > > Searching the WWW, I am finding (too) many interpretations of the >> output of "-verbose:gc" (or "-verbosegc", none of them starting from >> exactly the format above. >> I can kind of guess what the above means, but where can I find an >> "authoritative" interpretation for Sun/Oracle Java 1.6 ? >> >> Also, does anyone know if there is a way to specify that instead of >> the unreadable leading timestamp above, one can get a nicely-formatted >> one ? >> (-XX:+PrintGCTimeStamps ?) >> > > I use the following options: > > -Xloggc:gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps > > We use nice tool from HP (HPJmeter) at work. It parses GC logfile and > produces various graphs. I guess you can download it for free from > www.hp.com/go/java > > -- > Mikolaj Rydzewski > > > - > To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org > For additional commands, e-mail: users-h...@tomcat.apache.org > >
Re: Monitoring memory usage of JVM
On Fri, 27 May 2011 09:50:06 +0200, André Warnier wrote: Searching the WWW, I am finding (too) many interpretations of the output of "-verbose:gc" (or "-verbosegc", none of them starting from exactly the format above. I can kind of guess what the above means, but where can I find an "authoritative" interpretation for Sun/Oracle Java 1.6 ? Also, does anyone know if there is a way to specify that instead of the unreadable leading timestamp above, one can get a nicely-formatted one ? (-XX:+PrintGCTimeStamps ?) I use the following options: -Xloggc:gc.log -XX:+PrintGCDetails -XX:+PrintGCTimeStamps We use nice tool from HP (HPJmeter) at work. It parses GC logfile and produces various graphs. I guess you can download it for free from www.hp.com/go/java -- Mikolaj Rydzewski - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Monitoring memory usage of JVM
Pid wrote: On 26/05/2011 21:50, André Warnier wrote: André Warnier wrote: Pid wrote: On 26/05/2011 20:16, Caldarale, Charles R wrote: From: André Warnier [mailto:a...@ice-sa.com] Subject: Monitoring memory usage of JVM I am thinking of a couple of command-line options for the JVM, to dump for example some information each time a GC happens, Try -verbose:gc and -Xloggc: The jmap & jstat commands shipped with the JDK are also useful. Thanks to both. I'll try these out. For now, I have used the "-verbose:gc and -Xloggc:" command-line options, and added the jmap command into one of the other monitoring shell scripts I created. I'll have to wait for the next GC to see the output of the switches. As the application isn't doing anything right now, that could take a while. But a question about "jstat" in the meantime : In the documentation of jstat, it has this to say about the /lvmid/ part : port The default port for communicating with the remote server. If the hostname is omitted or the protocol specifies an optimized, local protocol, then port is ignored. Otherwise, treatment of the port parameter is implementation specific. For the default rmi protocol, the port indicates the port number for the rmiregistry on the remote host. If port is omitted, and protocol indicates rmi, then the default rmiregistry port (1099) is used. Is this the same port which I otherwise set for jconsole, iow via the option : -Dcom.sun.management.jmxremote.port= Yes, AFAIK. There's also a companion utility 'jstatd'. I'll just continue adding here, so that everything stays together. the output of the "-verbose:gc" switch looks as follows : ... 36980.453: [GC 479482K->271910K(994752K), 0.0135340 secs] 37085.411: [GC 511334K->269236K(992320K), 0.0130770 secs] 37750.377: [GC 508660K->276295K(999168K), 0.0124960 secs] 38078.813: [GC 524999K->286052K(997184K), 0.0077580 secs] 38187.341: [GC 534756K->295781K(1004032K), 0.0096650 secs] 38341.838: [GC 553765K->300854K(1001600K), 0.0230050 secs] ... Searching the WWW, I am finding (too) many interpretations of the output of "-verbose:gc" (or "-verbosegc", none of them starting from exactly the format above. I can kind of guess what the above means, but where can I find an "authoritative" interpretation for Sun/Oracle Java 1.6 ? Also, does anyone know if there is a way to specify that instead of the unreadable leading timestamp above, one can get a nicely-formatted one ? (-XX:+PrintGCTimeStamps ?) By the way, I know that there is an over-abudance of articles on the WWW about Java memory tuning, but here is one I found serendipitiously : http://fedora.fiz-karlsruhe.de/docs/Wiki.jsp?page=Java%20Heap%20%26%20GC%20Tuning Even if it appears to have been written mainly for one kind of application, it is short, readable, to-the-point, and I think usable in a broader context. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Monitoring memory usage of JVM
On 26/05/2011 21:50, André Warnier wrote: > André Warnier wrote: >> Pid wrote: >>> On 26/05/2011 20:16, Caldarale, Charles R wrote: >>>>> From: André Warnier [mailto:a...@ice-sa.com] Subject: Monitoring >>>>> memory usage of JVM >>>>> I am thinking of a couple of command-line options for the JVM, >>>>> to dump for example some information each time a GC happens, >>>> Try -verbose:gc and -Xloggc: >>> >>> The jmap & jstat commands shipped with the JDK are also useful. >>> >>> >> Thanks to both. >> I'll try these out. >> > For now, I have used the "-verbose:gc and -Xloggc:" command-line > options, and added the jmap command into one of the other monitoring > shell scripts I created. > I'll have to wait for the next GC to see the output of the switches. As > the application isn't doing anything right now, that could take a while. > > But a question about "jstat" in the meantime : > In the documentation of jstat, it has this to say about the /lvmid/ part : > > port > The default port for communicating with the remote server. If the > hostname is omitted or the protocol specifies an optimized, local > protocol, then port is ignored. Otherwise, treatment of the port > parameter is implementation specific. For the default rmi protocol, the > port indicates the port number for the rmiregistry on the remote host. > If port is omitted, and protocol indicates rmi, then the default > rmiregistry port (1099) is used. > > Is this the same port which I otherwise set for jconsole, iow via the > option : > -Dcom.sun.management.jmxremote.port= Yes, AFAIK. There's also a companion utility 'jstatd'. p signature.asc Description: OpenPGP digital signature
Re: Monitoring memory usage of JVM
André Warnier wrote: Pid wrote: On 26/05/2011 20:16, Caldarale, Charles R wrote: From: André Warnier [mailto:a...@ice-sa.com] Subject: Monitoring memory usage of JVM I am thinking of a couple of command-line options for the JVM, to dump for example some information each time a GC happens, Try -verbose:gc and -Xloggc: The jmap & jstat commands shipped with the JDK are also useful. Thanks to both. I'll try these out. For now, I have used the "-verbose:gc and -Xloggc:" command-line options, and added the jmap command into one of the other monitoring shell scripts I created. I'll have to wait for the next GC to see the output of the switches. As the application isn't doing anything right now, that could take a while. But a question about "jstat" in the meantime : In the documentation of jstat, it has this to say about the /lvmid/ part : port The default port for communicating with the remote server. If the hostname is omitted or the protocol specifies an optimized, local protocol, then port is ignored. Otherwise, treatment of the port parameter is implementation specific. For the default rmi protocol, the port indicates the port number for the rmiregistry on the remote host. If port is omitted, and protocol indicates rmi, then the default rmiregistry port (1099) is used. Is this the same port which I otherwise set for jconsole, iow via the option : -Dcom.sun.management.jmxremote.port= ? - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Monitoring memory usage of JVM
Pid wrote: On 26/05/2011 20:16, Caldarale, Charles R wrote: From: André Warnier [mailto:a...@ice-sa.com] Subject: Monitoring memory usage of JVM I am thinking of a couple of command-line options for the JVM, to dump for example some information each time a GC happens, Try -verbose:gc and -Xloggc: The jmap & jstat commands shipped with the JDK are also useful. Thanks to both. I'll try these out. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Monitoring memory usage of JVM
On 26/05/2011 20:16, Caldarale, Charles R wrote: >> From: André Warnier [mailto:a...@ice-sa.com] >> Subject: Monitoring memory usage of JVM > >> I am thinking of a couple of command-line options for the JVM, >> to dump for example some information each time a GC happens, > > Try -verbose:gc and -Xloggc: The jmap & jstat commands shipped with the JDK are also useful. p signature.asc Description: OpenPGP digital signature
RE: Monitoring memory usage of JVM
> From: André Warnier [mailto:a...@ice-sa.com] > Subject: Monitoring memory usage of JVM > I am thinking of a couple of command-line options for the JVM, > to dump for example some information each time a GC happens, Try -verbose:gc and -Xloggc: - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
Monitoring memory usage of JVM
Hi. Tomorrow morning (European time), we are planning a moment of peak usage of one Java daemon application. It is not Tomcat, but it behaves in a manner similar to Tomcat, in the sense that it listens on a TCP port, processes quasi-HTTP requests, creates threads as needed to process these requests, manages kind of sessions etc.. It is not our application and we do not have the source code. Our biggest concern is the amount of memory it will use under the predicted high load, as for each "session" it needs to parse and keep in memory the contents of a moderate-size XML file. We would like to monitor the memory usage of that JVM, but in a way that in itself does not impact the performance too much. Basically what we want, is to keep some information in a logfile, which in case of serious problem with memory would allow us to get a clue as to what is happening via some post-mortem analysis. So not just a dying dump, nor a nice GUI interface, but more in-between, like a trace log that gives us some "snapshots" on a minute-by-minute base (on on a GC-cycle base) of the evolution under load. Preferably also, not something that takes a big effort to set up. I am thinking of a couple of command-line options for the JVM, to dump for example some information each time a GC happens, but among the array of available switches I do not really know what to pick as a reasonable compromise. Since this place is packed with Java gurus (what we are not), any quick suggestions anyone ? Thanks. Oh, and here is the environment info : # java -version java version "1.6.0_22" Java(TM) SE Runtime Environment (build 1.6.0_22-b04) Java HotSpot(TM) 64-Bit Server VM (build 17.1-b03, mixed mode) The JVM of the application is started with "-Xms1024M -Xmx2048M", and no additional non-standard GC-related options right now. The host has a total of 12 GB RAM, of which only maybe half is really used for now. # uname -a Linux vixen2 2.6.26-2-amd64 #1 SMP Tue Jan 25 05:59:43 UTC 2011 x86_64 GNU/Linux - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory usage
Nope, but I'm not an expert with these (at all). I use something pretty similar, the only real difference is that I haven't turned on the CMSIncrementalMode. My apps haven't shown an issue with long pause times, so I haven't researched/tested it yet. Dan On Tue, Feb 2, 2010 at 1:55 PM, Carl wrote: > Dan, > > These are the Javs opts currently set in catalina.sh: > > JAVA_OPTS="-Xms512m -Xmx512m -XX:PermSize=384m -XX:MaxPermSize=384m > -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+PrintGCDetails > -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError > -XX:HeapDumpPath=/usr/local/tomcat/logs" > Do you see anything dangerous/wrong/not good? > > Thanks, > > Carl - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory usage
Dan, These are the Javs opts currently set in catalina.sh: JAVA_OPTS="-Xms512m -Xmx512m -XX:PermSize=384m -XX:MaxPermSize=384m -XX:+UseConcMarkSweepGC -XX:+CMSIncrementalMode -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/usr/local/tomcat/logs" Do you see anything dangerous/wrong/not good? Thanks, Carl - Original Message - From: "Dan Armbrust" To: "Tomcat Users List" ; Sent: Tuesday, February 02, 2010 2:07 PM Subject: Re: tomcat memory usage FYI - look out for this WRT MaxNewSize and NewRatio: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6862534 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory usage
FYI - look out for this WRT MaxNewSize and NewRatio: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6862534 - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory usage
On 29/01/2010 15:27, Caldarale, Charles R wrote: From: Pid [mailto:p...@pidster.com] Subject: Re: tomcat memory usage So the MaxNewSize, despite often being seen at high values in jmap outputs, is actually only applicable if the 'mx' allows it? Correct. Do you have an example of an erroneous MaxNewSize display? I seem to recall some problems with 32-bit JVMs and incorrect treatment of unsigned integers causing problems in the past. Not to hand, I'll poke around. Probably the source of my confusion is that I think I remember seeing the default value of MaxNewSize as 4096M, despite having manually set a lower value for mx. p THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory usage
> From: Pid [mailto:p...@pidster.com] > Subject: Re: tomcat memory usage > > So the MaxNewSize, despite often being seen at high values in > jmap outputs, is actually only applicable if the 'mx' allows it? Correct. Do you have an example of an erroneous MaxNewSize display? I seem to recall some problems with 32-bit JVMs and incorrect treatment of unsigned integers causing problems in the past. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory usage
On 29/01/2010 15:13, Caldarale, Charles R wrote: From: Pid [mailto:p...@pidster.com] Subject: Re: tomcat memory usage The overall size of the heap is controlled by 3 different groups of settings, not just the one you referred to: -Xms512M -Xmx512M -XX:NewSize=32m -XX:MaxNewSize=4096m -XX:PermSize=64m -XX:MaxPermSize=128m The overall amount of memory used is the sum of current values of each these groups, plus non-heap memory. (How'd I do?) Not well. The -Xmx and -Xms values include the NewSize; it is not a separate portion of the memory space as PermGen is. Dagnamit. So the MaxNewSize, despite often being seen at high values in jmap outputs, is actually only applicable if the 'mx' allows it? p - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory usage
> From: Pid [mailto:p...@pidster.com] > Subject: Re: tomcat memory usage > The overall size of the heap is controlled by 3 different groups of > settings, not just the one you referred to: > -Xms512M -Xmx512M > -XX:NewSize=32m -XX:MaxNewSize=4096m > -XX:PermSize=64m -XX:MaxPermSize=128m > > The overall amount of memory used is the sum of current values of each > these groups, plus non-heap memory. > > (How'd I do?) Not well. The -Xmx and -Xms values include the NewSize; it is not a separate portion of the memory space as PermGen is. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory usage
> From: Hüsnü Þentürk [mailto:husnusent...@yahoo.com] > Subject: Re: tomcat memory usage > > Is following classifications true for memory usage of Java ? Pretty much, but you're missing ancillary bits such as libraries, OS-created structures, statically linked code, dynamically generated code, stacks, and probably other things I'm leaving out. Running a process in a modern OS is complicated. > Sum of PermGen and Heap memory usage smalller then 600,980 KB which > I see on Task Manager. Can you explain the reason of this difference? Just because the virtual space is reserved doesn't mean it's actually being used in real memory. I don't know which of the memory values you chose to display in Task Manager, but it's probably real memory usage, which is only that part of the process space that the OS happens to have loaded at that instant. Nearly all components of memory usage change over time, both in virtual space and real, and there is no definitive relationship between the two. In other words, the Task Manager number is not terribly useful for tuning a Java execution, but it does provide some information when you're looking at the system as a whole. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory usage
On 29/01/2010 14:11, Hüsnü Þentürk wrote: Chuck and Chris, Thanks for yor explanations, Let me, try to summarize what I understand adding some extra info and ask my questions. Is following classifications true for memory usage of Java ? If not please correct it. A. Java memory usage when application is started as a windows service: 1. Heap memory * objects 2. Non-heap memory * PermGen (holds reflective data (meta-data) of the JVM itself, such as class and method objects and static fields ) * JVM's itself ( Garbage collector, managing heap etc.) * Java service wrapper dlls. B. Java memory usage when application is with a batch file: 1. Heap memory * objects 2. Non-heap memory * PermGen (holds reflective data (meta-data) of the JVM itself, such as class and method objects and static fields ) * JVM's itself ( Garbage collector, managing heap etc.) If I turn my first e-mail, in my example, java heap size was 512 MB, I did'nt define PermSize parameter so application uses default value 64 MB. Sum of PermGen and Heap memory usage smalller then 600,980 KB which I see on Task Manager. Can you explain the reason of this difference? Heap PermGen 512 MB+ 64 MB= 576 MB = 589824 KB<600980 KB Firs e-mail "In our company, we are using apache tomcat as a windows service. We defined jvm parameters "--JvmMs 512 --JvmMx 512" in service.bat. But application is using 600,980 KB memory. I expect the application not to use more then 512 MB." The overall size of the heap is controlled by 3 different groups of settings, not just the one you referred to: -Xms512M -Xmx512M -XX:NewSize=32m -XX:MaxNewSize=4096m -XX:PermSize=64m -XX:MaxPermSize=128m The overall amount of memory used is the sum of current values of each these groups, plus non-heap memory. (How'd I do?) p From: "Caldarale, Charles R" To: Tomcat Users List Sent: Wed, January 27, 2010 10:32:01 PM Subject: RE: tomcat memory usage From: Christopher Schultz [mailto:ch...@christopherschultz.net] Subject: Re: tomcat memory usage What else goes into PermGen, other than java.lang.Class objects? It varies by JVM level. In the original HotSpot implementation it was pretty much just the instances of java.lang.Class. As things evolved, a lot of class/method/field metadata migrated into PermGen from the C heap, pushed there, I suspect, by the growing use and sophistication of JMX and JVMTI, as well as making it easier for GC to clean up dead classes. AFAIK, none of these secondary structures are directly visible to Java code. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory usage
Chuck and Chris, Thanks for yor explanations, Let me, try to summarize what I understand adding some extra info and ask my questions. Is following classifications true for memory usage of Java ? If not please correct it. A. Java memory usage when application is started as a windows service: 1. Heap memory * objects 2. Non-heap memory * PermGen (holds reflective data (meta-data) of the JVM itself, such as class and method objects and static fields ) * JVM's itself ( Garbage collector, managing heap etc.) * Java service wrapper dlls. B. Java memory usage when application is with a batch file: 1. Heap memory * objects 2. Non-heap memory * PermGen (holds reflective data (meta-data) of the JVM itself, such as class and method objects and static fields ) * JVM's itself ( Garbage collector, managing heap etc.) If I turn my first e-mail, in my example, java heap size was 512 MB, I did'nt define PermSize parameter so application uses default value 64 MB. Sum of PermGen and Heap memory usage smalller then 600,980 KB which I see on Task Manager. Can you explain the reason of this difference? Heap PermGen 512 MB + 64 MB = 576 MB = 589824 KB < 600980 KB Firs e-mail "In our company, we are using apache tomcat as a windows service. We defined jvm parameters "--JvmMs 512 --JvmMx 512" in service.bat. But application is using 600,980 KB memory. I expect the application not to use more then 512 MB. " Thanks again. From: "Caldarale, Charles R" To: Tomcat Users List Sent: Wed, January 27, 2010 10:32:01 PM Subject: RE: tomcat memory usage > From: Christopher Schultz [mailto:ch...@christopherschultz.net] > Subject: Re: tomcat memory usage > > What else goes into PermGen, other than java.lang.Class objects? It varies by JVM level. In the original HotSpot implementation it was pretty much just the instances of java.lang.Class. As things evolved, a lot of class/method/field metadata migrated into PermGen from the C heap, pushed there, I suspect, by the growing use and sophistication of JMX and JVMTI, as well as making it easier for GC to clean up dead classes. AFAIK, none of these secondary structures are directly visible to Java code. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com
RE: tomcat memory usage
> From: Christopher Schultz [mailto:ch...@christopherschultz.net] > Subject: Re: tomcat memory usage > > What else goes into PermGen, other than java.lang.Class objects? It varies by JVM level. In the original HotSpot implementation it was pretty much just the instances of java.lang.Class. As things evolved, a lot of class/method/field metadata migrated into PermGen from the C heap, pushed there, I suspect, by the growing use and sophistication of JMX and JVMTI, as well as making it easier for GC to clean up dead classes. AFAIK, none of these secondary structures are directly visible to Java code. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
Re: tomcat memory usage
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 1/27/2010 2:50 PM, Caldarale, Charles R wrote: >> From: Christopher Schultz [mailto:ch...@christopherschultz.net] >> Subject: Re: tomcat memory usage >> >> The compiler knows that the "staticObject" member is static, and might >> even be able to tell the runtime that the object to be used for that >> static member should go into PermGen. > > You're confusing the reference with the object it points to. The > field containing the reference is in PermGen, the object the reference refers > to is in the main heap. I /was/ confused about your description, and I was sure that the object itself was stored in the heap. All you're saying is that, since Class objects are stored in PermGen, the memory required for their static object references is also stored in PermGen. That makes complete sense to me. >> The runtime doesn't know until the putstatic call that the object is >> destined to be a static reference. > > See above; "reference" != "object", but "reference" == pointer to > "object". (But I think you know that.) Thanks for the OO semantics lesson, professor :) I think my above statement was missing the "pointed to by a static reference". > No, the object will never migrate to PermGen space. (Nothing ever > migrates across the PermGen / main heap boundary, in either > direction.) Good to know. What else goes into PermGen, other than java.lang.Class objects? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktgoPUACgkQ9CaO5/Lv0PBmwQCeKZrCwPTT9Kp8V8qswxCZ4OKk Q3AAoJpZYaVBSGoQPmYn1c92mGxSlsHk =UiYy -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory usage
> From: Steffen Heil [mailto:li...@steffen-heil.de] > Subject: AW: tomcat memory usage > > I am not sure, where the Class objects themselfes reside. They are in PermGen along with a very few other internally-generated structures. > Whereever they are, static references are in there. Actually, there's no requirement that static fields be in the java.lang.Class instance or even in PermGen, as long as the interpreter, the two JITs, and GC know how to find them. It would be easy to locate static fields on the C heap, with just a pointer in the native part of the java.lang.Class instance to the location. But I believe they actually are in PermGen, since that makes the card table marking easier when a reference field is updated via putstatic. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
AW: tomcat memory usage
Hi > So, static members are stored outside the heap? Where are they stored? > PermGen? For sure, no. ALL persistent java objects are on the heap. With optimization some very short living objects may reside on the stack only. References to static objects ARE probably stored in PermGen, but the objects themselfes are surely not. They are created as any other object during object initialization using the new operator. I am not sure, where the Class objects themselfes reside. Maybe they are on PermGen or they are in the heap and are referenced in PermGen. Whereever they are, static references are in there. Regards, Steffen smime.p7s Description: S/MIME cryptographic signature
RE: tomcat memory usage
> From: Christopher Schultz [mailto:ch...@christopherschultz.net] > Subject: Re: tomcat memory usage > > The compiler knows that the "staticObject" member is static, and might > even be able to tell the runtime that the object to be used for that > static member should go into PermGen. You're confusing the reference with the object it points to. The field containing the reference is in PermGen, the object the reference refers to is in the main heap. > The runtime doesn't know until the putstatic call that the object is > destined to be a static reference. See above; "reference" != "object", but "reference" == pointer to "object". (But I think you know that.) > any long-living, heap-allocated object could be attached to > a static member at any time without warning. Sure; it happens all the time. > Does that mean that the putstatic opcode likely does one of two things: > 1. Immediately promote that object into the PermGen space > 2. Marks the object as destined for PermGen so that the GC can move it >whenever it wants No, the object will never migrate to PermGen space. (Nothing ever migrates across the PermGen / main heap boundary, in either direction.) > In either case, each object would need not only a regular reference > count but also a static reference count No Java GC mechanism has used reference counting for close to ten years now. All GC operations are performed by following reference chains from the roots (subject to a ton of acceleration techniques that avoid following all paths on all GCs). > Why not just have objects that end up bound to static members > grow old and move into the "old" generation just like most > long-lived objects? They do exactly that. The fact that a reference field is static says nothing about the expected lifetime of what the reference refers to. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
Re: tomcat memory usage
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 1/27/2010 1:50 PM, Caldarale, Charles R wrote: >> From: Christopher Schultz [mailto:ch...@christopherschultz.net] >> Subject: Re: tomcat memory usage >> >> So, static members are stored outside the heap? Where are they >> stored? PermGen? > > They're definitely not in the main Java heap; I'm pretty sure they're > in PermGen, although it's been awhile since I've looked at that code. > Keeping them in PermGen makes it easier for the all the GC > reference-chasing logic to work. This seems fishy to me. Consider the following. public class MyClass { public static Object staticObject = "static"; } The compiler knows that the "staticObject" member is static, and might even be able to tell the runtime that the object to be used for that static member should go into PermGen. But, now what happens if some other code does this: MyClass.staticObject = new String("new string"); (I intentionally used the "new" keyword to force a new object creation at runtime... not sure what the compiler/runtime does with string constants within the constant pool). The bytecode for that looks roughly like this: new String ldc "new string" invokespecial String.(String) putstatic MyClass.staticObject The runtime doesn't know until the putstatic call that the object is destined to be a static reference. Even if the compiler and runtime were to collude to make this happen in this contrived example, any long-living, heap-allocated object could be attached to a static member at any time without warning. Does that mean that the putstatic opcode likely does one of two things: 1. Immediately promote that object into the PermGen space 2. Marks the object as destined for PermGen so that the GC can move it whenever it wants In either case, each object would need not only a regular reference count but also a static reference count in case the object was still relevant but no longer bound to a static member, in which case it should be moved /back/ into the regular heap? That sounds like more work than is really necessary for the GC to perform. Why not just have objects that end up bound to static members grow old and move into the "old" generation just like most long-lived objects? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktglCkACgkQ9CaO5/Lv0PDr3ACdGSJQxadZHAHx5bjyjSRDpqyL /xEAn11hQJeGlz7H6dAlgecQElJTGSD0 =AKd+ -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory usage
> From: Christopher Schultz [mailto:ch...@christopherschultz.net] > Subject: Re: tomcat memory usage > > So, static members are stored outside the heap? Where are they stored? > PermGen? They're definitely not in the main Java heap; I'm pretty sure they're in PermGen, although it's been awhile since I've looked at that code. Keeping them in PermGen makes it easier for the all the GC reference-chasing logic to work. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
Re: tomcat memory usage
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Chuck, On 1/27/2010 11:28 AM, Caldarale, Charles R wrote: >> From: Christopher Schultz [mailto:ch...@christopherschultz.net] >> Subject: Re: tomcat memory usage >> >> All Java objects and their associated data are stored >> within the heap. > > Well... no. The OP's original question was about what was outside > the > -Xmx heap setting, and Class objects and the associated static fields > are /not/ included in that value. Instances of java.lang.Class and the > static fields are kept in PermGen, which is separate from the regular > Java heap, and sized independently of -Xmx. Fair enough. >> Unless you are writing JNI code, then everything you are >> effecting is happening in the heap. > > Also not strictly true, since a major chunk of the JVM and JRE are > native code, and consume considerable amounts of process space to > implement the Java operations. What I meant was that you can create as many objects as you want in Java and you aren't really stepping outside the Java heap. If you write JNI code, you can call malloc as much as you want and /that/ would be outside the Java heap. The OP can only cause the JVM to allocate a lot of memory for non-Java-heap items indirectly... say, but opening a bunch of sockets, creating a bunch of threads, etc. >> Static variables and references (which are the same thing, >> depending on how you see things) are not special in any way >> when it comes to memory use. > > Other than their location outside of the -Xmx-controlled heap. So, static members are stored outside the heap? Where are they stored? PermGen? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktgiEkACgkQ9CaO5/Lv0PAKKACgmDoe/8LislL/gddXNbyaeENM 7ysAoI8pT7suqp0zPphCQEIng8K+1md1 =QVxm -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
RE: tomcat memory usage
> From: Christopher Schultz [mailto:ch...@christopherschultz.net] > Subject: Re: tomcat memory usage > > All Java objects and their associated data are stored > within the heap. Well... no. The OP's original question was about what was outside the -Xmx heap setting, and Class objects and the associated static fields are /not/ included in that value. Instances of java.lang.Class and the static fields are kept in PermGen, which is separate from the regular Java heap, and sized independently of -Xmx. > Unless you are writing JNI code, then everything you are > effecting is happening in the heap. Also not strictly true, since a major chunk of the JVM and JRE are native code, and consume considerable amounts of process space to implement the Java operations. > Static variables and references (which are the same thing, > depending on how you see things) are not special in any way > when it comes to memory use. Other than their location outside of the -Xmx-controlled heap. > It's the JVM itself which is allocating memory outside that heap. And the OS and the various libraries used by the JVM. > Many DLLs loaded into a process's memory space are, in fact, shared > with many other processes. They're shared in real memory, but not process space (virtual memory). > the fact that WTM shows you only a single number for "memory" > means that you're not getting the whole story. The Task Manager can actually show several memory-related values, including virtual memory and various working set sizes. What's available to display depends heavily on the version of Windows one's using. > So, maybe WTM is giving you a decent measure of what memory is actually > being used by that process, specifically. Yes, it's pretty decent these days. Still has nothing to do with the Java heap, of course. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers.
Re: tomcat memory usage
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Hüsnü, On 1/27/2010 2:06 AM, Hüsnü Þentürk wrote: > As far as I know, heap memory is used by objects. On the other hand, > our application has static variables and references to the objects > residing in heap area. Does it mean, static variables and references > of our application are stored outside of reserved 512MB area? Or, the > memory outside of 512MB reserved heap area used only by Java itself? No. All Java objects and their associated data are stored within the heap. Unless you are writing JNI code, then everything you are effecting is happening in the heap. Static variables and references (which are the same thing, depending on how you see things) are not special in any way when it comes to memory use. It's the JVM itself which is allocating memory outside that heap. Memory, for instance, to help manage the heap itself. And all the threads you've got running. And the garbage collector. Basically: total memory = heap memory + non-heap memory Using JVM options, you can really only effect the heap memory size, the PermGen space, and the size of thread stacks. Basically, there is going to be some extra memory needed for non-heap stuff. Especially on Windows, I've seen reports of non-heap memory piling up quite a bit. Something else to note: Windows' Task Manager is a terrible tool for memory profiling, even without regard to Java's GC/heap issues. WTM just shows you a single number for "memory" and doesn't explain anything. Many DLLs loaded into a process's memory space are, in fact, shared with many other processes. For instance, win32.dll (or whatever it's called these days) gets mapped-into practically every process that runs under Microsoft Windows. The memory used by that DLL is proably counted against that process in WTM, when a lot of it is really being shared by all processes. Yes, there is a lot of process-private (and thread-private) data, but the fact that WTM shows you only a single number for "memory" means that you're not getting the whole story. Hmm... I'm looking at SysInternals (yes, they've been bought but I pine for Mark Russinovich's freedom) Process Explorer and it looks like WTM might be giving you the "private working set" which is essentially the memory that only that process is using. For instance, WTM reports that firefox.exe right now is using ~575MiB. (The column explicitly says "private working set" if I expand it enough). Process Explorer reports: Virtual Memory Private Bytes: ~ 762MiB Peak Private Bytes: ~ 880MiB Virtual Size: ~1108MiB Physical Memory: Working Set:~ 599MiB WS Private: ~ 575MiB WS Shareable: ~ 23MiB WS Shared:~ 10MiB Peak Working Set: ~ 835MiB WTM has gotten a lot better since the last time I checked: you can choose which columns to view and it has an array of memory-related data you can display. So, maybe WTM is giving you a decent measure of what memory is actually being used by that process, specifically. Anyhow, you have to realize that virtual machines are complex beasts and that there's more going on that your own code running inside that VM. Other than the surprising realization that a 512MiB heap yields a 600MiB process, is there a particular problem with the difference, here? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAktgYigACgkQ9CaO5/Lv0PAE4gCfe02Wp9q7LonyBl4a4b0+OyOP AFcAnjxPJ0djagrgBSWAlrETrsHhEkWJ =M6aj -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: tomcat memory usage
As far as I know, heap memory is used by objects. On the other hand, our application has static variables and references to the objects residing in heap area. Does it mean, static variables and references of our application are stored outside of reserved 512MB area? Or, the memory outside of 512MB reserved heap area used only by Java itself? From: Peter Crowther To: Tomcat Users List Sent: Tue, January 26, 2010 5:43:22 PM Subject: Re: tomcat memory usage 2010/1/26 Hüsnü Þentürk > Hi, > In our company, we are using apache tomcat as a windows service. We defined > jvm parameters "--JvmMs 512 --JvmMx 512" in service.bat. But application is > using 600,980 KB memory. I expect the application not to use more then 512 > MB. > > Can you explain me, the reason of this stuation. > > You are setting the memory that Java uses to store heap objects. That is not the only memory Java uses. Other uses include: - The JVM code itself; - Native code stacks per-thread; - Native objects such as sockets and threads; - Any loaded DLLs. You have no direct way of controlling the size of any of these. If you want to reduce Java's memory usage, you can reduce its heap space after monitoring what the process' overheads are. - Peter
Re: tomcat memory usage
2010/1/26 Hüsnü Þentürk > Hi, > In our company, we are using apache tomcat as a windows service. We defined > jvm parameters "--JvmMs 512 --JvmMx 512" in service.bat. But application is > using 600,980 KB memory. I expect the application not to use more then 512 > MB. > > Can you explain me, the reason of this stuation. > > You are setting the memory that Java uses to store heap objects. That is not the only memory Java uses. Other uses include: - The JVM code itself; - Native code stacks per-thread; - Native objects such as sockets and threads; - Any loaded DLLs. You have no direct way of controlling the size of any of these. If you want to reduce Java's memory usage, you can reduce its heap space after monitoring what the process' overheads are. - Peter
Re: tomcat memory usage
On 26/01/2010 15:12, Hüsnü Þentürk wrote: Hi, In our company, we are using apache tomcat as a windows service. We defined jvm parameters "--JvmMs 512 --JvmMx 512" in service.bat. But application is using 600,980 KB memory. I expect the application not to use more then 512 MB. Can you explain me, the reason of this stuation. Assuming they're actually working, those settings only govern the size of the heap. The JVM uses memory for things that are not part of the heap. p Informations: -- Server version: Apache Tomcat/6.0.20 Server built: May 14 2009 01:13:50 Server number: 6.0.20.0 OS Name:Windows 2003 OS Version: 5.2 Architecture: x86 JVM Version:1.5.0_04-b05 JVM Vendor: Sun Microsystems Inc. Thanks. Husnu Senturk - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
tomcat memory usage
Hi, In our company, we are using apache tomcat as a windows service. We defined jvm parameters "--JvmMs 512 --JvmMx 512" in service.bat. But application is using 600,980 KB memory. I expect the application not to use more then 512 MB. Can you explain me, the reason of this stuation. Informations: -- Server version: Apache Tomcat/6.0.20 Server built: May 14 2009 01:13:50 Server number: 6.0.20.0 OS Name: Windows 2003 OS Version: 5.2 Architecture: x86 JVM Version: 1.5.0_04-b05 JVM Vendor: Sun Microsystems Inc. Thanks. Husnu Senturk
Re: pump up memory usage
Very well, I just tried to inspire someone on how to 'pump up memory usage'. It wasn't about the details. In fact: one line of code doesn't compile without a class and method declaration. So you could have mailed me a java-for-beginners manual. :-) Cheers, Ronald. Op woensdag, 19 augustus 2009 22:49 schreef Christopher Schultz : -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ronald, On 8/19/2009 5:32 AM, Ronald Klop wrote: > byte[] b = new byte[100]; Java limits arrays to 2147483648 elements, so the above shouldn't even compile (and it doesn't for me). Section 2.15.4 of the JLS says: " A component of an array is accessed using an array access expression. Arrays may be indexed by int values; short, byte, or char values may also be used as they are subjected to unary numeric promotion (§2.6.10) and become int values. " Integer.MAX_VALUE is 2147483647 so the largest array you can allocate will actually have 2147483647 elements (and not 2147483648). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkqMZWQACgkQ9CaO5/Lv0PCIpACggoYXUr4aMq6bg35Irkxto4qd xcAAn2EgjuBtsRRpdWPH9y1VNl8PLgRw =f3l7 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: pump up memory usage
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Ronald, On 8/19/2009 5:32 AM, Ronald Klop wrote: > byte[] b = new byte[100]; Java limits arrays to 2147483648 elements, so the above shouldn't even compile (and it doesn't for me). Section 2.15.4 of the JLS says: " A component of an array is accessed using an array access expression. Arrays may be indexed by int values; short, byte, or char values may also be used as they are subjected to unary numeric promotion (§2.6.10) and become int values. " Integer.MAX_VALUE is 2147483647 so the largest array you can allocate will actually have 2147483647 elements (and not 2147483648). - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iEYEARECAAYFAkqMZWQACgkQ9CaO5/Lv0PCIpACggoYXUr4aMq6bg35Irkxto4qd xcAAn2EgjuBtsRRpdWPH9y1VNl8PLgRw =f3l7 -END PGP SIGNATURE- - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: pump up memory usage
byte[] b = new byte[100]; Op woensdag, 19 augustus 2009 10:51 schreef "Thomas G. Lau" : Dear Tomcat Users, how could I pump up memory usage on tomcat? we want to test if tomcat having any problem when changed environment from 32 bit 2GB limitation to 64bit larger memory limitation mode. Thanks. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
pump up memory usage
Dear Tomcat Users, how could I pump up memory usage on tomcat? we want to test if tomcat having any problem when changed environment from 32 bit 2GB limitation to 64bit larger memory limitation mode. Thanks. - To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org For additional commands, e-mail: users-h...@tomcat.apache.org
Re: Auto Session Creation and memory usage
Jacob Rhoden wrote: > I am working on creating some more scalable tomcat applications. I have > addedd a SessionListener and it seems that hitting a jsp page triggers a > session to be created. > > If there are 1000 users and only 10 are signed in, I dont think 1000 > sessions need to be created yes. How do I turn off auto session > creation, or is this impossible. > > (Google has not been my friend in this regard, do people not think about > this sort of thing?) I'd consider it very likely that people actually do think about this sort of thing. And that they set session="false" in the JSP page directive if they don't want a session to be created. Regards mks - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Auto Session Creation and memory usage
Hi Guys, I am working on creating some more scalable tomcat applications. I have addedd a SessionListener and it seems that hitting a jsp page triggers a session to be created. If there are 1000 users and only 10 are signed in, I dont think 1000 sessions need to be created yes. How do I turn off auto session creation, or is this impossible. (Google has not been my friend in this regard, do people not think about this sort of thing?) -jacob - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory Usage Differ for same TOMCAT5.5.23
Hi java on UNIX by default starts in 32 bit mode to run java in 64 bit mode , java -d64 is specified so for TOMCAT on catalina.sh HOW TO for JAVA_HOME in 64 bit ? with regards Karthik Mark Thomas wrote: karthikn wrote: Hi Please need this Information Memory Usage Differ for same TOMCAT5.5.23 on 32 / 64 bit Java Version ? None. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory Usage Differ for same TOMCAT5.5.23
karthikn wrote: Hi Please need this Information Memory Usage Differ for same TOMCAT5.5.23 on 32 / 64 bit Java Version ? None. Mark - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Memory Usage Differ for same TOMCAT5.5.23
Hi Please need this Information Memory Usage Differ for same TOMCAT5.5.23 on 32 / 64 bit Java Version ? with regards Karthik - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory usage in Tomcat 6
> From: Billy Ng [mailto:[EMAIL PROTECTED] > Subject: Re: Memory usage in Tomcat 6 > > Changing the -Xmsm and -Xmxm in the tomcatw.exe That's tomcat6w.exe, not tomcatw.exe. > If you still have problem, there must be some huge > objects created from time to time. It can also be PermGen space (classes) that is full, rather than the normal heap. Other resource exhaustion (e.g., file handles) can also cause OOMEs on occasion. > You need to use tool like figure it out. Yes, a profiler - or even JConsole - is very useful here. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory usage in Tomcat 6
9 out of 10 are the heap size problem. Changing the -Xmsm and -Xmxm in the tomcatw.exe if you are using Windows. On the 32-bit Windows, you can only allocate 1.2 GB max. If you still have problem, check all the static vars to see any objects are growing forever. If you still have problem, there must be some huge objects created from time to time. You need to use tool like figure it out. Billy Ng - Original Message - From: "Tuan Quan" <[EMAIL PROTECTED]> To: Sent: Monday, June 16, 2008 9:11 AM Subject: Memory usage in Tomcat 6 Hi all, how do I adjust Memory allocation Tomcat 6, running as service in Windows? I ran into "out of memory" error. thanks. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory usage in Tomcat 6
> From: Tuan Quan [mailto:[EMAIL PROTECTED] > Subject: Memory usage in Tomcat 6 > > Hi all, how do I adjust Memory allocation Tomcat 6, running > as service in Windows? Use the tomcat6w.exe program in Tomcat's bin directory. Read the FAQ for memory usage information: http://wiki.apache.org/tomcat/FAQ/Memory JConsole (part of the HotSpot JVM SDK) is a good tool for monitoring memory usage on the fly. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Memory usage in Tomcat 6
Hi all, how do I adjust Memory allocation Tomcat 6, running as service in Windows? I ran into "out of memory" error. thanks.
Re: Tomcat 5.0.28 memory usage - garbage collection
thanks Chris - the reason we are tied to j2sdk 1.4.2_12 is because it is recommended by the the packaged webapp - we are customiznig it and we have experienced major minor version issues when we try to deploy our customized code with the packaged webapp. in short package s/w is done using j2sdk1.4.2_12 our custom layer ontop of it has to stick to that thank Christopher Schultz-2 wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > tootbatoot, > > tootbatoot wrote: > | Hi Thanks. the two applications run on their own and don't share jvm > so I can > | use different versions - but the webapp I have deployed in tomcat server > | requires it to be either on 5.0.28 or 5.5.17 (but using j2sdk1.4.2_12) > - - we > | are using 5.0.28. > > Okay. That doesn't seem to be a problem. > > | thanks for clarifying the behavior of memory - do you see any > performance > | gains if I switch to 5.5.17 from 5.0.28. > > My understanding is that TC 5.5 has a better architecture, which I > assume means that certain performance characteristics will be better, > but the #1 reason to move from TC 5.0 to TC 5.5 is that TC 5.0 is no > longer supported. Not even security patches. You should upgrade so that > you will be running a version of TC supported by the developers /and/ > the community. > > | the only problem I have on my end > | i that I have to use plugin for 5.5.17 for backward compatibility to > | j2sdk1.4.2_12. > > That's not a problem. The compatibility package was developed just for > that reason. again... why are you bound to a 1.4 JVM? > > - -chris > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.9 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkhSlZEACgkQ9CaO5/Lv0PCE0QCeJq6vTUHvz5xgmUIZGM5QZCIW > MlwAoKf1sUEZmjLKuJA8OMAO6Ic6d3HY > =F75G > -END PGP SIGNATURE- > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Tomcat-5.0.28-memory-usage---garbage-collection-tp17800619p17826655.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.0.28 memory usage - garbage collection
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 tootbatoot, tootbatoot wrote: | Hi Thanks. the two applications run on their own and don't share jvm so I can | use different versions - but the webapp I have deployed in tomcat server | requires it to be either on 5.0.28 or 5.5.17 (but using j2sdk1.4.2_12) - - we | are using 5.0.28. Okay. That doesn't seem to be a problem. | thanks for clarifying the behavior of memory - do you see any performance | gains if I switch to 5.5.17 from 5.0.28. My understanding is that TC 5.5 has a better architecture, which I assume means that certain performance characteristics will be better, but the #1 reason to move from TC 5.0 to TC 5.5 is that TC 5.0 is no longer supported. Not even security patches. You should upgrade so that you will be running a version of TC supported by the developers /and/ the community. | the only problem I have on my end | i that I have to use plugin for 5.5.17 for backward compatibility to | j2sdk1.4.2_12. That's not a problem. The compatibility package was developed just for that reason. again... why are you bound to a 1.4 JVM? - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhSlZEACgkQ9CaO5/Lv0PCE0QCeJq6vTUHvz5xgmUIZGM5QZCIW MlwAoKf1sUEZmjLKuJA8OMAO6Ic6d3HY =F75G -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.0.28 memory usage - garbage collection
Hi Thanks. the two applications run on their own and don't share jvm so I can use different versions - but the webapp I have deployed in tomcat server requires it to be either on 5.0.28 or 5.5.17 (but using j2sdk1.4.2_12) - we are using 5.0.28. thanks for clarifying the behavior of memory - do you see any performance gains if I switch to 5.5.17 from 5.0.28 . the only problem I have on my end i that I have to use plugin for 5.5.17 for backward compatibility to j2sdk1.4.2_12. thanks Christopher Schultz-2 wrote: > > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > tootbatoot wrote: > | The reason we have to stick to using this version is that it is > recommended > | by another application that tomcat is acting as a client to. > > Do you mean that your (Tomcat-hosted) application is connecting to a > 3rd-party application? If they are not running in the same JVM, there > should be no reason that different JVM versions cannot be used. The > 3rd-party can use whatever they want (1.4?) while you run a newer version. > > | From your posts - I understand that the memory usage might show going > up all > | the time - and it will still be ok because it is showing the heap size > of > | jvm. > > Yes. The JVM generally does not request memory from the OS and then give > it back, later. The JVM's memory usage for the Java heap (from the OS's > perspective) will only increase. > > - -chris > -BEGIN PGP SIGNATURE- > Version: GnuPG v1.4.9 (MingW32) > Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org > > iEYEARECAAYFAkhRhkoACgkQ9CaO5/Lv0PA6FgCeOrSevoJ+S7MlJuBUMpfMIJrL > H9sAnRCXFHnikaIHkCb+Epj3FRj3q00M > =w52N > -END PGP SIGNATURE- > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Tomcat-5.0.28-memory-usage---garbage-collection-tp17800619p17819205.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Tomcat 5.0.28 memory usage - garbage collection
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 tootbatoot wrote: | The reason we have to stick to using this version is that it is recommended | by another application that tomcat is acting as a client to. Do you mean that your (Tomcat-hosted) application is connecting to a 3rd-party application? If they are not running in the same JVM, there should be no reason that different JVM versions cannot be used. The 3rd-party can use whatever they want (1.4?) while you run a newer version. | From your posts - I understand that the memory usage might show going up all | the time - and it will still be ok because it is showing the heap size of | jvm. Yes. The JVM generally does not request memory from the OS and then give it back, later. The JVM's memory usage for the Java heap (from the OS's perspective) will only increase. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhRhkoACgkQ9CaO5/Lv0PA6FgCeOrSevoJ+S7MlJuBUMpfMIJrL H9sAnRCXFHnikaIHkCb+Epj3FRj3q00M =w52N -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.0.28 memory usage - garbage collection
thanks. The reason we have to stick to using this version is that it is recommended by another application that tomcat is acting as a client to. >From your posts - I understand that the memory usage might show going up all the time - and it will still be ok because it is showing the heap size of jvm. Caldarale, Charles R wrote: > >> From: tootbatoot [mailto:[EMAIL PROTECTED] >> Subject: RE: Tomcat 5.0.28 memory usage - garbage collection >> >> jdk1.4.2_12 > > I'd strongly recommend upgrading to a newer JVM. 1.6 especially is > noticeably faster than 1.4 and includes better heap management. You > should upgrade Tomcat as well, for the similar reasons. > >> I am checking the numbers from task manager console and >> not sure whether these are virtual or real ones? > > While you have the Processes tab displayed, click on the View menu, then > Select Columns. Pick whatever you want to look at. The memory entries > that don't say virtual are refer to real memory usage. > > - Chuck > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY > MATERIAL and is thus for use only by the intended recipient. If you > received this in error, please contact the sender and delete the e-mail > and its attachments from all computers. > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Tomcat-5.0.28-memory-usage---garbage-collection-tp17800619p17802394.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.0.28 memory usage - garbage collection
> From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] > Subject: RE: Tomcat 5.0.28 memory usage - garbage collection > > I'd strongly recommend upgrading to a newer JVM. 1.6 > especially is noticeably faster than 1.4 and includes better > heap management. You should upgrade Tomcat as well, for the > similar reasons. If you upgrade, you'll also have much better tools available (e.g., JConsole) to monitor the JVM and Tomcat. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.0.28 memory usage - garbage collection
> From: tootbatoot [mailto:[EMAIL PROTECTED] > Subject: RE: Tomcat 5.0.28 memory usage - garbage collection > > jdk1.4.2_12 I'd strongly recommend upgrading to a newer JVM. 1.6 especially is noticeably faster than 1.4 and includes better heap management. You should upgrade Tomcat as well, for the similar reasons. > I am checking the numbers from task manager console and > not sure whether these are virtual or real ones? While you have the Processes tab displayed, click on the View menu, then Select Columns. Pick whatever you want to look at. The memory entries that don't say virtual are refer to real memory usage. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.0.28 memory usage - garbage collection
Thanks. Sorry for not including the environment info - here it is: OS: Windows server 2003 SP1 jdk1.4.2_12 I am checking the numbers from task manager console and not sure whether these are virtual or real ones? how to find this, thanks. t Caldarale, Charles R wrote: > >> From: tootbatoot [mailto:[EMAIL PROTECTED] >> Subject: Tomcat 5.0.28 memory usage - garbage collection >> >> When I put load on it via my webapp - I can see the memory >> allocated to the process going up (in task manager) but >> when I kill the session of the webapp (i.e. remove the load) >> it does not come down. Should not the tomcat process release >> memory when there is no load ? > > In a word, no. On most JVMs, once the virtual memory for the heap is > allocated due to peak load, it stays allocated. However, you didn't tell > us if you're looking at real or virtual memory numbers; the real memory > can fluctuate simply because the OS chooses to page some of it out. > > You also didn't bother to tell us the JDK and OS you're using (likely some > form of Windows), and your're running on an unsupported version of Tomcat. > > - Chuck > > > THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY > MATERIAL and is thus for use only by the intended recipient. If you > received this in error, please contact the sender and delete the e-mail > and its attachments from all computers. > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > > -- View this message in context: http://www.nabble.com/Tomcat-5.0.28-memory-usage---garbage-collection-tp17800619p17801715.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Tomcat 5.0.28 memory usage - garbage collection
> From: tootbatoot [mailto:[EMAIL PROTECTED] > Subject: Tomcat 5.0.28 memory usage - garbage collection > > When I put load on it via my webapp - I can see the memory > allocated to the process going up (in task manager) but > when I kill the session of the webapp (i.e. remove the load) > it does not come down. Should not the tomcat process release > memory when there is no load ? In a word, no. On most JVMs, once the virtual memory for the heap is allocated due to peak load, it stays allocated. However, you didn't tell us if you're looking at real or virtual memory numbers; the real memory can fluctuate simply because the OS chooses to page some of it out. You also didn't bother to tell us the JDK and OS you're using (likely some form of Windows), and your're running on an unsupported version of Tomcat. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Tomcat 5.0.28 memory usage - garbage collection
Hi Guys - Can you please help me understand behavior of 5.0.28 tomcat. When I put load on it via my webapp - I can see the memory allocated to the process going up (in task manager) but when I kill the session of the webapp (i.e. remove the load) it does not come down. Should not the tomcat process release memory when there is no load ? thanks -- View this message in context: http://www.nabble.com/Tomcat-5.0.28-memory-usage---garbage-collection-tp17800619p17800619.html Sent from the Tomcat - User mailing list archive at Nabble.com. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Jconsole or JMXPROXY monitoring memory usage of the system
Christopher Schultz wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Liang, Liang Xiao Zhu wrote: | I would like to know if there is some way which I can monitoring of the | memory usage through of Tomcat. I mean, I have currently running a | Tomcat 6 server, and through that I want to know not only the memory | usage of JVM also the memory usage of the system. I don't believe the JVM has access to this information directly. You'd have to write your own native code to interrogate the operating system for this information. I wouldn't be surprised if something like this already exists somewhere. Note that this would not be a Tomcat-specific library -- it would be applicable in any Java program, not just a web application. To offer a solution idea that would on the other hand be very specific and non-portable, but maybe usable if this is for one server and you do not find anything more elegant : It must be possible in a servlet to execute a system-level command, grab its output and filter it to get what you want to know. I could tell you how to do this under Apache and perl, but unfortunately I don't know under Tomcat and Java. But I am sure that someone on this list can give us a tip. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Jconsole or JMXPROXY monitoring memory usage of the system
Thanks for your answer!!! Christopher Schultz escribió: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Liang, Liang Xiao Zhu wrote: | I would like to know if there is some way which I can monitoring of the | memory usage through of Tomcat. I mean, I have currently running a | Tomcat 6 server, and through that I want to know not only the memory | usage of JVM also the memory usage of the system. I don't believe the JVM has access to this information directly. You'd have to write your own native code to interrogate the operating system for this information. I wouldn't be surprised if something like this already exists somewhere. Note that this would not be a Tomcat-specific library -- it would be applicable in any Java program, not just a web application. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhP2e4ACgkQ9CaO5/Lv0PBQDACdH9FlRCwENZixWUsy+uT6AvKl f3gAn3s99h/jWf4TUzIeqswdBviWWecp =+6fS -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Jconsole or JMXPROXY monitoring memory usage of the system
Can anyone help me? Liang Xiao Zhu escribió: Hi, I would like to know if there is some way which I can monitoring of the memory usage through of Tomcat. I mean, I have currently running a Tomcat 6 server, and through that I want to know not only the memory usage of JVM also the memory usage of the system. Thanks in advance - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Jconsole or JMXPROXY monitoring memory usage of the system
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 André, André Warnier wrote: | Is there some kind of general source of information, or registry or | repository, where one could find [...] a list of already-developed add-on modules for Tomcat? Not really. Most of the Tomcat-specific stuff actually comes with Tomcat. Outside of that, there are tons of tools out there that are built for generic (servlet-spec-conforming) web applications. A good example is url-rewrite (http://tuckey.org/urlrewrite/) which is often mentioned on this list. It is by no means Tomcat-specific, so it doesn't really belong on a "Tomcat Add-Ons" page. Rather, it belongs on a "useful web application libraries" page. I can think of about 100 libraries myself that could go on that list, and there are surely thousands more. Google is a better list keeper than anyone here would be. | I can consult the list of add-ons at httpd.apache.org Yes, but these are modules supplied by Apache directly. Anything that is Tomcat-related actually comes with Tomcat (except for mod_jk, which is easily findable on the website as well). | when I want to know the same for perl modules, I go to www.cpan.org. | What about Tomcat ? Tomcat just doesn't have that kind of community infrastructure. Are you volunteering? ;) - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhP25QACgkQ9CaO5/Lv0PDezQCfRe2Rol+oNSHExFlU0b7ytrsd rMMAn0OdH3uMzPmCbiXAyJrbUQzuyhqP =G2KB -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Jconsole or JMXPROXY monitoring memory usage of the system
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Liang, Liang Xiao Zhu wrote: | I would like to know if there is some way which I can monitoring of the | memory usage through of Tomcat. I mean, I have currently running a | Tomcat 6 server, and through that I want to know not only the memory | usage of JVM also the memory usage of the system. I don't believe the JVM has access to this information directly. You'd have to write your own native code to interrogate the operating system for this information. I wouldn't be surprised if something like this already exists somewhere. Note that this would not be a Tomcat-specific library -- it would be applicable in any Java program, not just a web application. - -chris -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.9 (MingW32) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iEYEARECAAYFAkhP2e4ACgkQ9CaO5/Lv0PBQDACdH9FlRCwENZixWUsy+uT6AvKl f3gAn3s99h/jWf4TUzIeqswdBviWWecp =+6fS -END PGP SIGNATURE- - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Jconsole or JMXPROXY monitoring memory usage of the system
Hi. May I take the opportunity and ride on the question below, to ask : Is there some kind of general source of information, or registry or repository, where one could find the answer to the question below, but also get a list of already-developed add-on modules for Tomcat ? I mean, when I need to find out if there already exists an add-on to Apache for authentication via a post-gothic chocolate cookie server, I can consult the list of add-ons at httpd.apache.org; and when I want to know the same for perl modules, I go to www.cpan.org. What about Tomcat ? Thanks in advance, André Liang Xiao Zhu wrote: Hi, I would like to know if there is some way which I can monitoring of the memory usage through of Tomcat. I mean, I have currently running a Tomcat 6 server, and through that I want to know not only the memory usage of JVM also the memory usage of the system. Thanks in advance - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Jconsole or JMXPROXY monitoring memory usage of the system
Hi, I would like to know if there is some way which I can monitoring of the memory usage through of Tomcat. I mean, I have currently running a Tomcat 6 server, and through that I want to know not only the memory usage of JVM also the memory usage of the system. Thanks in advance - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Setting Tomcat memory usage
> From: Chris Richmond [mailto:[EMAIL PROTECTED] > Subject: Setting Tomcat memory usage > > set JAVA_OPTS = -Xms512m -Xmx512m Take out the spaces around the equals sign. Windows interprets the above as a setting for "JAVA_OPTS " (note the trailing space) rather than "JAVA_OPTS", so it will be ignored by the scripts. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Setting Tomcat memory usage
Hello all, I read the documentation on the Tomcat6 site and I have attempted to modify the max jvm memory settings when tomcat starts up by modifying Catalina.bat, but it *appears* to have no effect. Here is a summary of the situation and what I have done. I am using Tomcat6 stable release, WinXP, java 1.6 I am running tomcat from zip distribution and not from an installed windows service. I am using the startup/shutdown .bat files to start/stop my tomcat instance I have run some test code in a simple web service inside of tomcat to determine the max memory settings for the JVM that tomcat is using. Runtime rt = Runtime.getRuntime(); return rt.maxMemory(); the value that gets returned : 66650112 I shutdown tomcat, and modified Catalina.bat with the following in the JAVA_OPTS section(I included the surrounding remarks for context) rem JAVA_OPTS (Optional) Java runtime options used when the "start", rem "stop", or "run" command is executed set JAVA_OPTS = -Xms512m -Xmx512m I then restarted tomcat, ran my service call above and it still returns the same value for maxmemory from within my tomcat webservice. >From reading the Tomcat Docs/ FAQ, and Googling I think that I am setting what I need to set(Catalina.bat), but it seems to have no effect. What resource am I not taking advantage of with this information, or what am I missing to set the max memory usage in the JVM when Tomcat starts up? Thank you for your time in reading this, Chris
RE: Adjust max memory usage in Tomcat
> From: Alexander Diedler [mailto:[EMAIL PROTECTED] > Subject: Adjust max memory usage in Tomcat > > How Can I adjust the maximum memory usage for Tomcat process? 1) Learn how to use Java. 2) Read the Tomcat FAQ. http://wiki.apache.org/tomcat/FAQ/Memory 3) Search the archives. http://marc.info/?l=tomcat-user 4) Tell us what Tomcat version. 5) Tell us what JVM version. 6) Tell us the platform you're running on. 7) Tell us how you're running Tomcat (as a service or via scripts). - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Adjust max memory usage in Tomcat
Hello, How Can I adjust the maximum memory usage for Tomcat process? Greetings Alexander Diedler
RE: memory usage of specific webapp with jmx
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] > Subject: memory usage of specific webapp with jmx > > I hope that I can also see the size of the web application > without writing Java code. Nope, and probably not even by writing Java code. > I think so because web application classes are loaded with > WebClassLoader so the WebClassLoader can count memory size > per application. No, because the predominant use of memory is objects allocated on the Java heap, which is shared by everything running in that JVM, regardless of what loaded it. You can remove all applications other than the one of interest, put a load on it with whatever testing tools you use, and watch the effect on the heap. You could also use a profiler to see where objects are being created, and try to tie that back to specific applications. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
memory usage of specific webapp with jmx
Hi, Can I see the memory usage of the web application deployed in Tomcat with JMX. By now I can connect to Tomcat with jconsole and see the summary memory size. I hope that I can also see the size of the web application without writing Java code. I think so because web application classes are loaded with WebClassLoader so the WebClassLoader can count memory size per application. Best regards, - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: memory usage increases on application stop
> From: David Delbecq [mailto:[EMAIL PROTECTED] > Subject: Re: memory usage increases on application stop > > Note that the PermSize is taken from the heap, > so it should be lower than max heap size. Not true in a HotSpot JVM; the heap and PermGen settings are independent. The virtual space for the heap and PermGen is allocated in one chunk, using the total of the sizes. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: memory usage increases on application stop
En l'instant précis du 11/01/08 09:34, Morten Matras s'exprimait en ces termes: Case: I've deployed an application on a Tomcat 6.0 (current release). The application is a Hibernate / Stripes application. Almost no memory is allocated due to the deployed application. Setting: -Xmx64m -XX:MaxPermSize=128m According to memory below, those settings are not take into account, or you wouldn't go over about 70M total space (java heap space of 64M max + jvm code of a few megs). Note that the PermSize is taken from the heap, so it should be lower than max heap size. Tomcat without application uses: 27,5M (real memory) and 349M (virtual memory) Tomcat with application uses: 133M (real memory) and 367M (Virtual memory) Now if I stop this application (using the manager) the memory profile becomes: Tomcat with stopped application: 128M (real memory) and 679M (virtual memory) So stopping the application increases the virtual memory usage from 367 to 679 m and stays there! The increase is probably due to specific code your application executes when it is stopped. It seems to do memory intesive things there :) You have to be aware a JVM memory never decrease in terms of system memory size. It can only grow up to the -Xmx size. (See sun's jvm docs for details). To get an idea of what memory size is really available for your jvm, you must check the values inside the jvm (use the system class, or a easy to use tool like lambda probe). If, even after a GC, memory is not release inside the java heap, then go check for memory leaks in your webapp. Undeploying a stopped application doesn't change the numbers. Why does stopping (or undeploying) a webapplication cause a dramatic increase in memory usage? My guesses: - Some ressources are not freed? (database connections) - Some hibernate related stuff are trapped in a circular relation circle? - Tomcat punishes me for stopping something it really liked :-) -- http://www.devlog.be (a belgian developer's logs) - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: memory usage
> From: Jordi Prats [mailto:[EMAIL PROTECTED] > Subject: memory usage > > There's any way to identify witch application and witch class > is getting to many memory? Read the FAQ: http://wiki.apache.org/tomcat/FAQ/Memory > How can I get some statistics about tomcat's memory usage? The same way you would with any other Java program - JConsole is a good starting point, but you'll likely need a profiler. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
memory usage
Hi, I'm getting out of memory errors on tomcat: Mar 27, 2007 5:21:46 AM org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor processChildren SEVERE: Exception invoking periodic operation: java.lang.OutOfMemoryError: Java heap space Mar 27, 2007 5:21:52 AM unknown unknown SEVERE: Error finishing response java.lang.OutOfMemoryError: Java heap space Mar 27, 2007 5:21:51 AM org.apache.catalina.core.StandardWrapperValve invoke SEVERE: Servlet.service() for servlet bitstream threw exception java.lang.OutOfMemoryError: Java heap space There's any way to identify witch application and witch class is getting to many memory? I think that some application creates a immense array by never delete any data. How can I get some statistics about tomcat's memory usage? Many thanks! Jordi - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
memory usage increases on application stop
Case: I've deployed an application on a Tomcat 6.0 (current release). The application is a Hibernate / Stripes application. Almost no memory is allocated due to the deployed application. Setting: -Xmx64m -XX:MaxPermSize=128m Tomcat without application uses: 27,5M (real memory) and 349M (virtual memory) Tomcat with application uses: 133M (real memory) and 367M (Virtual memory) Now if I stop this application (using the manager) the memory profile becomes: Tomcat with stopped application: 128M (real memory) and 679M (virtual memory) So stopping the application increases the virtual memory usage from 367 to 679 m and stays there! Undeploying a stopped application doesn't change the numbers. Why does stopping (or undeploying) a webapplication cause a dramatic increase in memory usage? My guesses: - Some ressources are not freed? (database connections) - Some hibernate related stuff are trapped in a circular relation circle? - Tomcat punishes me for stopping something it really liked :-) -- Morten Matras Udviklingschef GAMP Media og Blob Communication ApS Svendsagervej 42 5240 Odense NØ Tlf: 61711103 E: [EMAIL PROTECTED] T: 76 654321 W: www.blobcom.com E: [EMAIL PROTECTED]
RE: Memory usage problem
> From: Christoph Sperle [mailto:[EMAIL PROTECTED] > Subject: RE: Memory usage problem > > Do you have a hint to restrict/reduce the overall process > memory tomcat uses. 1) Eliminate unnecessary items in server.xml (e.g., unused connectors). 2) Reduce the number of threads configured for each connector. 3) Don't deploy any unnecessary webapps (eats up file descriptors). 4) Package webapp classes into as few jars as possible (more file descriptors). 5) Insure the applications aren't opening files or starting auxiliary threads unnecessarily. Don't know how much any of the above will help, since the impact is very dependent on the particular OS you're using and how efficient it is at conserving resources. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory usage problem
Thank you Chuck, you are right. But for me, that remains a big problem (and I read about it many times in VPS forums too): How to restrict the process size of tomcat? If I stop tomcat and measure the free memory (on a VPS that's not easy at all, see http://www.webhostingtalk.com/showpost.php?p=4851698&postcount=6): Used memory = 86m After I started tomcat (with my single webapp and heap restricted to 64m): Used memory = 365m That's 280m -> more as four times of the heap size restriction! I never saw this behavior at any other java program. Do you have a hint to restrict/reduce the overall process memory tomcat uses. Thanks Christoph -Original Message- From: Caldarale, Charles R [mailto:[EMAIL PROTECTED] Sent: Mittwoch, 19. Dezember 2007 15:42 To: Tomcat Users List Subject: RE: Memory usage problem > From: Christoph Sperle [mailto:[EMAIL PROTECTED] > Subject: Memory usage problem > > As you can see, tomcat uses 138m, even though, it was start > up with 64m restriction (-Xmx64m). You're confusing heap size (-Xmx) with total process space. The total process space includes many other things besides the JVM heap, such as code banks, stacks, internal JVM structures, OS-related structures, etc. Even so, 138M is pretty tiny, these days. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
RE: Memory usage problem
> From: Christoph Sperle [mailto:[EMAIL PROTECTED] > Subject: Memory usage problem > > As you can see, tomcat uses 138m, even though, it was start > up with 64m restriction (-Xmx64m). You're confusing heap size (-Xmx) with total process space. The total process space includes many other things besides the JVM heap, such as code banks, stacks, internal JVM structures, OS-related structures, etc. Even so, 138M is pretty tiny, these days. - Chuck THIS COMMUNICATION MAY CONTAIN CONFIDENTIAL AND/OR OTHERWISE PROPRIETARY MATERIAL and is thus for use only by the intended recipient. If you received this in error, please contact the sender and delete the e-mail and its attachments from all computers. - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Memory usage problem
Hello all I run tomcat on a virtual private server with very limited resources. Therefore I want tomcat to run with very restrictive memory usage. I tried hard to get this done, but with no success. Tomcat uses as much memory as it wants to use, regardless of the specified startup settings. OS: Ubuntu Server 6.10 Tomcat: 5.0.30 'ps': tomcat5 26107 0.7 3.5 341488 141492 ? Sl 08:18 3:01 /usr/lib/j2sdk1.5-sun/bin/java -Djava.awt.headless=true -server -Xms48m -Xmx64m ... 'top': 26107 tomcat5 17 0 333m 138m 16m S0 3.5 3:02.97 java As you can see, tomcat uses 138m, even though, it was start up with 64m restriction (-Xmx64m). What's wrong here? Kind regards Christoph Sperle - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Diagnosing Tomcat memory usage
plug in a profiler, I use www.yourkit.com, you can get memory stats, like the ones you wish for, live. other profilers will do the job as well Filip Andrew Hole wrote: I've an java application running under tomcat and in the last week memory usage increase 50%, from 200M to 400M. I want to know exactly why this happens. Some suggestion? Thanks a lot - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Diagnosing Tomcat memory usage
Actually, you have no idea how much your code actually increased it. You just think it increased 50%, because that is what the OS sees. If you were using 190 MB of memory before, the JVM may have left your system usage at 200 MB. Then, when your app bumps the memory up to 201 MB, the JVM needs to get more memory from the system. So it typically doubles what it currently has allocated. Thats why you jumped from 200 to 400. So, while your usage may have only gone up by a few MB, due to a higher concurrent load, whatever, it looks like it doubled, because that is how the JVM behaves. And the JVM will never release that memory back to the system - it will stay at 400 MB until the next time you restart it. If you have a leak, and a few weeks from now, you use up all of the 400 MB, the next jump will probably be 800 MB. If you want to find out how much memory you are actually using, you need to look inside the VM, with a tool like "jstat" (part of java). On 10/10/07, Andrew Hole <[EMAIL PROTECTED]> wrote: > I've an java application running under tomcat and in the last week > memory usage increase 50%, from 200M to 400M. I want to know exactly > why this happens. Some suggestion? > > Thanks a lot > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Diagnosing Tomcat memory usage
Try Lambda Probe as recommended by other contributors to this list. http://www.lambdaprobe.org/d/index.htm I'm no expert with this tool but it's straightforward to install and I think it may help you out a bit. The System Information/Memory Utilization thing is particularly fascinating although I don't fully understandthe output yet. I also used the JProbe profiller some time ago to profile a running instance of Weblogic, it had a fantastic real time heap analysis tool that shows you exactly what's happening at runtime ... 2 million String objects, where the heck did they come from ? It's not free though as far as I know. It might help On 10/10/07, Andrew Hole <[EMAIL PROTECTED]> wrote: > I've an java application running under tomcat and in the last week > memory usage increase 50%, from 200M to 400M. I want to know exactly > why this happens. Some suggestion? > > Thanks a lot > > - > To start a new topic, e-mail: users@tomcat.apache.org > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Diagnosing Tomcat memory usage
I've an java application running under tomcat and in the last week memory usage increase 50%, from 200M to 400M. I want to know exactly why this happens. Some suggestion? Thanks a lot - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: Memory usage with multiple instances of tomcat
Thank you Chuck and Chris for your help and advice. I will definitely be reading your refs Chris Regards Peter - To start a new topic, e-mail: users@tomcat.apache.org To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]