Feature #6827
reduce the memory footprint of WrappedResource implementations: replace BDTs with Java types
90%
Related issues
History
#1 Updated by Constantin Asofiei over 1 year ago
- Related to Feature #6826: reduce the BDT usage in FWD runtime added
#2 Updated by Constantin Asofiei over 1 year ago
This task is meant to look at WrappedResource implementations ('handles' in OE) and replace all BDT state with Java state.
#3 Updated by Constantin Asofiei over 1 year ago
Some changes are in 3821c/14272. Greg, please review.
#4 Updated by Greg Shah over 1 year ago
- Assignee set to Stanislav Lomany
#5 Updated by Stanislav Lomany over 1 year ago
- Status changed from New to WIP
- File 6827.diff added
Sorry, guys, I think I've reviewed all FWD classes implemening WrappedResource
but there're no usages of BDT. I've found a couple of cases which cannot be replaced and a single case which I've optimized (see attached diff).
I suppose majority of the cases was fixed by Constantin in rev 14272. Am I missing something?
#6 Updated by Constantin Asofiei over 1 year ago
This code:
Reflections reflections = new Reflections("com.goldencode."); Set<Class<? extends WrappedResource>> classes = new TreeSet<>((c1, c2) -> c1.getName().compareTo(c2.getName())); classes.addAll(reflections.getSubTypesOf(WrappedResource.class)); for (Class<?> cls : classes) { Field[] fields = cls.getDeclaredFields(); for (int i = 0; i < fields.length; i++) { Field f = fields[i]; Class<?> type = f.getType(); if (BaseDataType.class.isAssignableFrom(type)) { System.out.println(cls.getName() + ": " + f.getName() + " of type " + f.getType().getSimpleName()); } } }
gets these fields with BDT type:
com.goldencode.p2j.comauto.ComObject: parentProcedure of type handle com.goldencode.p2j.persist.AbstractTempTable: defaultBufferHandle of type handle com.goldencode.p2j.persist.AbstractTempTable: errorString of type character com.goldencode.p2j.persist.AbstractTempTable: error of type logical com.goldencode.p2j.persist.AbstractTempTable: admData of type character com.goldencode.p2j.persist.BufferImpl: lastQuery of type handle com.goldencode.p2j.persist.BufferImpl: oldName of type character com.goldencode.p2j.persist.DataSource: query of type handle com.goldencode.p2j.ui.BrowseWidget: report of type handle com.goldencode.p2j.ui.ControlEntityExt: comData of type comhandle com.goldencode.p2j.ui.GenericWidget: pendingScreenValue of type character com.goldencode.p2j.ui.ImageListWidget: listImages of type handle com.goldencode.p2j.ui.MenuWidget: titleBgColor of type int64 com.goldencode.p2j.ui.MenuWidget: titleDColor of type int64 com.goldencode.p2j.ui.MenuWidget: titleFgColor of type int64 com.goldencode.p2j.ui.MenuWidget: titleFont of type int64 com.goldencode.p2j.ui.TreeListWidget: WHITE of type integer com.goldencode.p2j.ui.TreeNodeCollectionResource: DEFAULT_VALUE of type character com.goldencode.p2j.ui.TreeNodeResource: value of type character com.goldencode.p2j.ui.TreeWidgetBase: nodeImageListHandle of type handle com.goldencode.p2j.ui.ocx.DataObject: filesHandle of type comhandle com.goldencode.p2j.ui.ocx.ListImage: picture of type comhandle com.goldencode.p2j.ui.ocx.ListImage: tag of type BaseDataType com.goldencode.p2j.ui.ocx.ListImage: self of type comhandle com.goldencode.p2j.util.AsyncRequestImpl: server of type handle com.goldencode.p2j.util.AsyncRequestImpl: eventProcedure of type character com.goldencode.p2j.util.AsyncRequestImpl: eventProcedureContext of type handle com.goldencode.p2j.util.AsyncRequestImpl: persistentProcedure of type handle com.goldencode.p2j.util.AsyncRequestImpl: procedureName of type character com.goldencode.p2j.util.AsyncRequestImpl: requestInfo of type object com.goldencode.p2j.util.AsyncRequestImpl: responseInfo of type object com.goldencode.p2j.util.Call: admData of type character com.goldencode.p2j.util.Call: inHandle of type handle com.goldencode.p2j.util.Call: returnValue of type BaseDataType com.goldencode.p2j.util.Call: server of type handle com.goldencode.p2j.util.Call: asyncHandle of type handle com.goldencode.p2j.util.Call: eventProcedureContext of type handle com.goldencode.p2j.util.HandleChain: name of type character com.goldencode.p2j.util.PortTypeWrapper: admData of type character com.goldencode.p2j.util.PortTypeWrapper: requestHeaderProc of type character com.goldencode.p2j.util.PortTypeWrapper: requestHeaderContext of type handle com.goldencode.p2j.util.PortTypeWrapper: responseHeaderProc of type character com.goldencode.p2j.util.PortTypeWrapper: responseHeaderContext of type handle com.goldencode.p2j.util.ProxyProcedureWrapper: fileName of type character com.goldencode.p2j.util.SOAPHeaderEntryImpl: admData of type character com.goldencode.p2j.util.SOAPHeaderImpl: admData of type character com.goldencode.p2j.util.SensitiveResource: sensitive of type logical com.goldencode.p2j.util.ServerImpl: requestInfo of type object com.goldencode.p2j.util.ServerImpl: responseInfo of type object com.goldencode.p2j.util.SocketImpl: readResponseProcedure of type character com.goldencode.p2j.util.SocketImpl: readResponseContext of type handle com.goldencode.p2j.util.SocketListenerImpl: connectProcedure of type character com.goldencode.p2j.util.SocketListenerImpl: connectProcedureContext of type handle com.goldencode.p2j.util.TransactionImpl: txInitProcedure of type handle com.goldencode.p2j.xml.SaxEntityImpl: admData of type character com.goldencode.p2j.xml.SaxReaderImpl: hCallback of type handle com.goldencode.p2j.xml.SaxWriterImpl: standalone of type logical
This was done over 6129b/14341.
Please work on fixing them, start with the non-UI classes.
#7 Updated by Constantin Asofiei over 1 year ago
I think the object
fields need to remain as-is, for the reference counting to work (which affects when these get destroyed).
#8 Updated by Constantin Asofiei over 1 year ago
Stanislav, do you need help here?
#9 Updated by Stanislav Lomany over 1 year ago
I'm still on #6821, so feel free to do anything you want here.
#10 Updated by Constantin Asofiei over 1 year ago
- Assignee changed from Stanislav Lomany to Constantin Asofiei
#11 Updated by Constantin Asofiei over 1 year ago
6129b/14366 contains a set of changes related to this, I don't think there's anything else remaining related to the weight of a WrappedResource instance, when referring to BDTs or handle.
#12 Updated by Constantin Asofiei over 1 year ago
- % Done changed from 0 to 90
Profiling and manual/automated code review was used to identify BDT and collection fields in WrappedResource implementations. BDT fields were replaced with their Java counterpart, and collections (were possible) were lazy-initialized. Only classes remaining are from p2j.ui
.