Path: csiph.com!eternal-september.org!feeder.eternal-september.org!news.eternal-september.org!.POSTED!not-for-mail From: Cecil Westerhof Newsgroups: comp.lang.java.programmer Subject: Re: Restricting the memory usage of a Java program Date: Sat, 13 Aug 2016 02:52:16 +0200 Organization: Decebal Computing Lines: 23 Message-ID: <8760r5lccf.fsf@Equus.decebal.nl> References: <8760r7m18z.fsf@Equus.decebal.nl> <87wpjml720.fsf@Equus.decebal.nl> <87fuq9lgzr.fsf@Equus.decebal.nl> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="12baf5125b19322b899c79c2e3878015"; logging-data="3135"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18g6oJ4M+CL2AQsgUHuWtVPV6P2yiEQIpU=" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-Homepage: http://www.decebal.nl/ Cancel-Lock: sha1:k15rpUp/PF/pTN90BZZW1+ABq44= sha1:d1AZ3wH79Qy2mHX0w+J6hC88hRc= Xref: csiph.com comp.lang.java.programmer:35284 On Saturday 13 Aug 2016 01:11 CEST, Cecil Westerhof wrote: >>> Just to be sure: maxMemory cannot change during the run of a Java >>> application? >> >> That is my understanding. See previous post. > > But it can, I just saw: > freeAfter freeBefore maxMemory totalAfter totalBefore > "185" "65" "239" "239" "242" > "101" "96" "228" "155" "155" > > So first maxMemory was 228. An hour later total was 242 before gc. > After gc total was 239 and maxMemory was changed from 228 to 239. But it is also given back, the next line (an hour later) reeds: freeAfter freeBefore maxMemory totalAfter totalBefore "120" "42" "228" "174" "174" -- Cecil Westerhof Senior Software Engineer LinkedIn: http://www.linkedin.com/in/cecilwesterhof