通过超图的iobjectjava架包开发相应的功能,并发布成服务,可以通过服务请求方式调用。
第一次请求调用功能正常,如果第一次执行完,立马请求第二次,运行过程中,jvm则会崩溃。
如果第一次请求执行完,间隔上10分钟左右,再请求第二次,则可以正常运行。
导致不能连续请求的原因,似乎是存在超图架包调用dl,而l资源没有彻底释放的原因。
而且每次崩溃的位置并不会很固定。
Stack: [0x000000007f6e0000,0x000000007f7e0000], sp=0x000000007f7dbff8, free space=1007k
Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code)
C 0x00007ffd309b20b0
Java frames: (J=compiled Java code, j=interpreted, Vv=VM code)
J 8488 com.supermap.data.ToolkitNative.jni_GetBooleanHandle(J)Z (0 bytes) @ 0x00000000051cc4c1 [0x00000000051cc480+0x41]
J 8486 C1 com.supermap.realspace.networkanalyst.NetworkBuilder3D.steppedCallBack(IJLjava/lang/String;Ljava/lang/String;J)V (56 bytes) @ 0x00000000052389ec [0x00000000052388e0+0x10c]
v ~StubRoutines::call_stub
j com.supermap.realspace.networkanalyst.NetworkBuilder3DNative.jni_BuildNetwork([J[J[Ljava/lang/String;[Ljava/lang/String;JLjava/lang/String;ID)J+0
j com.supermap.realspace.networkanalyst.NetworkBuilder3D.buildNetwork(Lcom/supermap/data/DatasetVector;Lcom/supermap/data/DatasetVector;[Ljava/lang/String;[Ljava/lang/String;Lcom/supermap/data/Datasource;Ljava/lang/String;Lcom/supermap/realspace/networkanalyst/NetworkSplitMode3D;D)Lcom/supermap/data/DatasetVector;+367
j z.s.cache.service.cacheSrv.CreateNetwork3D(Lcom/supermap/data/Workspace;Ljava/lang/String;Lcom/supermap/data/DatasetVector;Lcom/supermap/data/DatasetVector;)V+224
j z.s.cache.service.cacheSrv.CreateDataSets(Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/String;Lcom/supermap/data/Workspace;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)V+330
j z.s.cache.service.cacheSrv.Vectoring(Ljava/lang/String;Ljava/lang/Integer;Ljava/util/List;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z+317
j z.s.cache.service.cacheSrv.publishServices(Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;)V+295
j z.s.cache.thread.CacheThread.run()V+23
j java.lang.Thread.run()V+11
v ~StubRoutines::call_stub
private void CreateNetwork3D(Workspace workspace, String networkName, DatasetVector dv3DLine,DatasetVector dv3DPoint) {
try {
Datasource datasource = workspace.getDatasources().get(0);
String availableName = datasource.getDatasets().getAvailableDatasetName(networkName,DatasetType.NETWORK3D);
List<String> lineFieldNames = new ArrayList<>();
List<String> pointFieldNames = new ArrayList<>();
FieldInfos lineFieldInfos = dv3DLine.getFieldInfos();
for(int i=0;i<lineFieldInfos.getCount();i++)
{
String fieldName = lineFieldInfos.get(i).getName();
if(!fieldName.toUpperCase().contains("SM"))
{
lineFieldNames.add(fieldName);
}
}
FieldInfos pointFieldInfos = dv3DPoint.getFieldInfos();
for(int i=0;i<pointFieldInfos.getCount();i++)
{
String fieldName = pointFieldInfos.get(i).getName();
if(!fieldName.toUpperCase().contains("SM"))
{
pointFieldNames.add(fieldName);
}
}
String[] tempLineFields=lineFieldNames.toArray(new String[lineFieldNames.size()]);
String[] temppointFields=pointFieldNames.toArray(new String[pointFieldNames.size()]);
NetworkBuilder3D.buildNetwork(dv3DLine,dv3DPoint,tempLineFields,temppointFields,datasource,availableName, NetworkSplitMode3D.LINE_SPLIT_BY_POINT,0.00001);
}
catch (Exception ex)
{
ex.getMessage();
}
}