[x3d-public] X3DJSAIL apps. Generating and compiling Java. Avoiding code toolarge.

yottzumm at gmail.com yottzumm at gmail.com
Fri Mar 24 05:11:35 PDT 2017


I think it’s some setting deep inside javac.  I am not sure if it can be overridden or not.  I will pass you the logs, and you can try some files for yourself, now that you have a Java code generator 😊.  You can exercise your code generator to see if we can get any more examples compiled.  But really, I think your reflection loader will solve the issue.

$ sh noncompiled.sh | xargs -L 1 -P 8 javac -J-Xss16m -J-Xmx4096M 2> javacerrors.txt

$ cat noncompiled.sh
find . -name '*.java'| grep -v " "| sed 's/\.java$/.class/'| xargs ls 2>&1| grep "No such file or directory" | awk '{ print $4; }'| sed "s/^'\.\///" | sed "s/\.class':/.java/"

I think the stack overflows were resolved.  Attached are JavaCErrors.zip remaining. (336MB)

Maybe try removing tabs?  LOL

Are we ready to move to python yet?

John
Sent from Mail for Windows 10

From: Don Brutzman
Sent: Friday, March 24, 2017 2:04 AM
To: yottzumm at gmail.com
Cc: X3D Graphics public mailing list; x3d at web3d.org; Roy Walmsley
Subject: Re: X3DJSAIL apps. Generating and compiling Java. Avoiding code toolarge.

On 3/23/2017 6:58 PM, yottzumm at gmail.com wrote:
> So many of my last few hundred files have Java compiler errors are “code to large.”  This is because I am generating all the Java in one main method.

Can you increase your memory/stack/heap to the process?

> Suggestions for breaking this up into multiple methods are welcome.  Note that much of the code is now in a single humongous statement, so it could be difficult or easy to break up.  I was thinking breaking at a certain number of levels of X3D, or perhaps every “new.”

Breaking at each new, or upon discovery of a very large attribute, is possible.

> I’m also overflowing the javac stack in some cases.  This is a concern, and may require another compiler?

some hints about memory for building with Ant can be found at

	Savage Developer Guide: Ant
	https://savage.nps.edu/Savage/developers.html#Ant

i.e. ANT_OPTS=-Xss16m -Xmx4096M

These are just pass-through values to the underlying JVM, you can also read about them from console:

javac -help -X
======================================================
Usage: javac <options> <source files>
where possible options include:
   -g                         Generate all debugging info
   -g:none                    Generate no debugging info
   -g:{lines,vars,source}     Generate only some debugging info
   -nowarn                    Generate no warnings
   -verbose                   Output messages about what the compiler is doing
   -deprecation               Output source locations where deprecated APIs are used
   -classpath <path>          Specify where to find user class files and annotation processors
   -cp <path>                 Specify where to find user class files and annotation processors
   -sourcepath <path>         Specify where to find input source files
   -bootclasspath <path>      Override location of bootstrap class files
   -extdirs <dirs>            Override location of installed extensions
   -endorseddirs <dirs>       Override location of endorsed standards path
   -proc:{none,only}          Control whether annotation processing and/or compilation is done.
   -processor <class1>[,<class2>,<class3>...] Names of the annotation processors to run; bypasses default discovery process
   -processorpath <path>      Specify where to find annotation processors
   -parameters                Generate metadata for reflection on method parameters
   -d <directory>             Specify where to place generated class files
   -s <directory>             Specify where to place generated source files
   -h <directory>             Specify where to place generated native header files
   -implicit:{none,class}     Specify whether or not to generate class files for implicitly referenced files
   -encoding <encoding>       Specify character encoding used by source files
   -source <release>          Provide source compatibility with specified release
   -target <release>          Generate class files for specific VM version
   -profile <profile>         Check that API used is available in the specified profile
   -version                   Version information
   -help                      Print a synopsis of standard options
   -Akey[=value]              Options to pass to annotation processors
   -X                         Print a synopsis of nonstandard options
   -J<flag>                   Pass <flag> directly to the runtime system
   -Werror                    Terminate compilation if warnings occur
   @<filename>                Read options and filenames from file

   -Xlint                     Enable recommended warnings
   -Xlint:{all,auxiliaryclass,cast,classfile,deprecation,dep-ann,divzero,empty,fallthrough,finally,options,overloads,overrides,path,processing,rawtypes,serial,static,try,unchecked,varargs,-auxiliaryclass,-cast,-classfile,-deprecation,-dep-ann,-divzero,-empty,-fallthrough,-finally,-options,-overloads,-overrides,-path,-processing,-rawtypes,-serial,-static,-try,-unchecked,-varargs,none} Enable or disable specific warnings
   -Xdoclint                  Enable recommended checks for problems in javadoc comments
   -Xdoclint:(all|none|[-]<group>)[/<access>]
         Enable or disable specific checks for problems in javadoc comments,
         where <group> is one of accessibility, html, missing, reference, or syntax,
         and <access> is one of public, protected, package, or private.
   -Xbootclasspath/p:<path>   Prepend to the bootstrap class path
   -Xbootclasspath/a:<path>   Append to the bootstrap class path
   -Xbootclasspath:<path>     Override location of bootstrap class files
   -Djava.ext.dirs=<dirs>     Override location of installed extensions
   -Djava.endorsed.dirs=<dirs> Override location of endorsed standards path
   -Xmaxerrs <number>         Set the maximum number of errors to print
   -Xmaxwarns <number>        Set the maximum number of warnings to print
   -Xstdout <filename>        Redirect standard output
   -Xprint                    Print out a textual representation of specified types
   -XprintRounds              Print information about rounds of annotation processing
   -XprintProcessorInfo       Print information about which annotations a processor is asked to process
   -Xprefer:{source,newer}    Specify which file to read when both a source file and class file are found for an implicitly compiled class
   -Xpkginfo:{always,legacy,nonempty} Specify handling of package-info files
   -Xplugin:"name args"       Name and optional arguments for a plug-in to be run
   -Xdiags:{compact,verbose}  Select a diagnostic mode

These options are non-standard and subject to change without notice.
======================================================

all the best, Don
-- 
Don Brutzman  Naval Postgraduate School, Code USW/Br       brutzman at nps.edu
Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA   +1.831.656.2149
X3D graphics, virtual worlds, navy robotics http://faculty.nps.edu/brutzc

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170324/b3bf7557/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: JavaCErrors.zip
Type: application/zip
Size: 336883 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20170324/b3bf7557/attachment-0001.zip>


More information about the x3d-public mailing list