You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- missing semicolon in POJO generator
- make file name and class name consistent
- do not generate NAMES field if it is too long
- Right now each string in NAMES field occupies 4bytes in the static initializer of class,
so the limit is ~ 65536/(2*2*4) since we need to load all strings from NAMES array and ColInfo
in static initializer. And static initializer influences the size of
resulting class.
- do not generate ColInfo if it is not necessary.
privateSBtoJavaNAMES( SBsb ) { returnJCodeGen.toStaticVar(sb, "NAMES", _names, "Names of columns used by model."); }
659
+
privateSBtoJavaNAMES( SBsb ) {
660
+
//
661
+
intlimit = ((1<<16) /* Max size of class */ - 4 * 500/* Free space for loading any static stuff */ ) / (4*2*2); // Static initialized needs 4 instructions to load String from constant pool + load ColInfo
662
+
return_names.length < limit ?
663
+
JCodeGen.toStaticVar(sb, "NAMES", _names, "Names of columns used by model.") :
664
+
JCodeGen.toStaticVar(sb, "NAMES", JCodeGen.EMPTY_SA, "Names of columns used by model. WARNING: It is too large to be generated!");
665
+
}
660
666
protectedSBtoJavaNCLASSES( SBsb ) { returnisClassifier() ? JCodeGen.toStaticVar(sb, "NCLASSES", nclasses(), "Number of output classes included in training data response column.") : sb; }
0 commit comments