From mboxrd@z Thu Jan 1 00:00:00 1970 X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fa528,4b9ff8efa3fbc0af,start X-Google-Attributes: gidfa528,public X-Google-ArrivalTime: 2002-10-31 22:58:24 PST Path: archiver1.google.com!news1.google.com!newsfeed.stanford.edu!bloom-beacon.mit.edu!news-out.cwix.com!newsfeed.cwix.com!opentransit.net!fr.clara.net!heighliner.fr.clara.net!deine.net!feed.cgocable.net!feed.tor.primus.ca!news.primus.ca!53ab2750!not-for-mail Message-ID: <3dc22636_1@news.iprimus.com.au> From: Philip Yarra Subject: JDK 1.4.0-1 memory problems Newsgroups: comp.unix.tru64 User-Agent: KNode/0.7.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit X-Original-NNTP-Posting-Host: 210.50.235.174 Organization: iPrimus Customer - reports relating to abuse should be sent to abuse@iprimus.com.au X-Original-NNTP-Posting-Host: 127.0.0.1 Date: Fri, 01 Nov 2002 17:57:59 +1100 NNTP-Posting-Host: 203.134.67.67 X-Complaints-To: news@primus.ca X-Trace: news.primus.ca 1036133880 203.134.67.67 (Fri, 01 Nov 2002 01:58:00 EST) NNTP-Posting-Date: Fri, 01 Nov 2002 01:58:00 EST Xref: archiver1.google.com comp.unix.tru64:9015 Hi, I'm not sure if this is right forum for this, but here goes: I have written a java console application, to be run on Tru64, designed to stress-test one of our applications. It can potentially spawn a lot of threads - on my Linux workstation I was getting OutOfMemoryErrors. After an ugly workaround (see hackish code below) it runs quite well [on my workstation]. Sooo... transferred the app over to the test Tru64 box. At the really stressful part of the app (spawning a lot of threads) the VM abruptly dies, with a range of console errors such as: htable_insert: out of memory, file /util/htable.c, line 276 or pool_alloc: out of memory, file /util/pool.c, line 117 or array_enlarge: out of memory, file /util/sarray.c, line 37 ...and sometimes it runs fine. Not often though! The section of code that I think is bombing is public void sendTransaction() { boolean spawned = false; while(!spawned) { try { transactionThread tx = new transactionThread(this); tx.start(); spawned = true; } catch(OutOfMemoryError oe) { try { Thread.sleep(100); } catch(InterruptedException e) {} } catch(Throwable t) { System.err.println("sendTransaction: caught an exception"); t.printStackTrace(System.err); System.exit(1); } } It's entirely possible for this function to be executed 1000 times or so in a row, resulting in a lot of threads... to the point where the VM on my Linux box gave up (gracefully), hence the try and catch for OutOfMemoryError. I kind of expected that Tru64 might also have trouble spawning that many threads so rapidly, but expected that OutOfMemoryError conditions would be caught by existing code. Anyone got any ideas on this? It looks to me like a problem with the VM implementation itself. I'd like to try an earler VM (1.3.x) but since this app includes 1.4 specific code, I can't unless I rewrite it. Other workarounds might be to manually limit (in Java) the number of allowed threads, but I would prefer to avoid this, as it would necessarily be arbitrary based on our Alpha's setup and some trial and error. I also tried some playing around with thread stack size with -Xssn, but I can't find a lot of doco about it (for example, what are the units? How should the required amount be calculated? etc) The app did not bomb out when I manually set -Xss, but it ran once, then never finished its second run. It seemed to have hung badly. Since I had no real idea what to do with this option, I stopped. System details (mail me if you need more details) $ sizer -v Digital UNIX V4.0F (Rev. 1229) $ java -version java version "1.4.0" Java(TM) 2 Runtime Environment, Standard Edition Fast VM (build 1.4.0-1, native threads, mixed mode, precompiled rt.jar, 09/05/2002-19:05) Hoping someone out there might be using the same Java version on Tru64 and be able to help. Regards, Philip Yarra. -- ++real email address has netDOTau, not tenDOTau