Community
Participate
Working Groups
Hi, Firstly, I am just getting on AspectJ, so apologies in advance for any (stupid) mistake on my part. The following aspect I am testing ( to time RMI messages ) does compilte fine on its own. However, when I submit to the compiler an "injar" of byte source classes, the compiler chokes with an OutOfMemoryError: I then tried the compiler and gave it the original source of that byte code and it does fail again this time indicating an internal compiler error when at line 0 of a source file (where this is just the opening comment "/*" ...) (I need to obfuscate the commercial code stuff .. sorry). Thanx in advance bash-2.05b$ ajc -1.4 -verbose -argfile achatvente.lst - sourceroots "src;../thirdparty/src" -outjar achatvente. jar zipfile classpath entry does not exist: c:\j2sdk1.4.1_01\jre\lib\i18n.jar directory classpath entry does not exist: c:\j2sdk1.4.1_01\jre\classes java.lang.OutOfMemoryError C:\development\thirdparty\src\com\product\MyFile.java:0 Internal compiler error java.lang.OutOfMemoryError !! no source information available !! ABORT Exception thrown from AspectJ 1.1rc1 This might be logged as a bug already -- find current bugs at http://bugs.eclipse.org/bugs/buglist.cgi?product=AspectJ&component=Compiler Bugs for exceptions thrown have titles File:line from the top stack, e.g., "SomeFile.java:243" If you don't find the exception below in a bug, please add a new bug at http://bugs.eclipse.org/bugs/enter_bug.cgi?product=AspectJ To make the bug a priority, please include a test program that can reproduce this exception. null java.lang.OutOfMemoryError 1 fail|abort, 1 error import java.rmi.server.RemoteRef; import java.rmi.Remote; import java.lang.reflect.*; aspect RemoteObjectAspect { Object around (Remote remote, Method method, Object[] objectArray, long long3) : call(Object RemoteRef.invoke(..)) && args(remote, method, objectArray, long3) { long start = new java.util.Date().getTime () ; Object ret = proceed (remote, method, objectArray, long3) ; start = new java.util.Date().getTime () - new java.util.Date ().getTime () ; // Log the time wherever needed. System.err.println ("Timed Method: " + method + " on object " + remote + " ... TIME (ms) : " + start) ; return ret ; } }
Hi, Looking again at the bug db, it seems that this bug is caused by the 1000 file limit I have seen in the bug list as it does happen after a few files are being treated. regards,
There is no hard limit on the number of files that ajc can handle. However, ajc is known to use more memory than javac. See the FAQ entry on OutOfMemoryError for more information on solutions to this problem. We should modify the error handling in the compiler so that an OutOfMemoryError will point people to the FAQ (we did this in 1.0). I'll leave the bug open until that is done. You can find the FAQ entry at: http://dev.eclipse.org/viewcvs/indextech.cgi/~checkout~/aspectj- home/doc/faq.html#q:ajcoom
*** Bug 36234 has been marked as a duplicate of this bug. ***
Memory problems in the compiler are now handled in a much more graceful way (see resolution of bug 36234. Separate bug 35547 is tracking the issue of reducing the amount of memory that AspectJ needs.