Difference between revisions of "Template:ComChannelMemoryUsageNote"

From emotive
Jump to navigation Jump to search
(Created page with "{{Important| '''For long-time running procedures''': The OTX runtime will close open ComChannels solely via the CloseComChannel activity! The has an impact on the long-time st...")
 
Line 1: Line 1:
{{Important| '''For long-time running procedures''': The OTX runtime will close open ComChannels solely via the CloseComChannel activity! The has an impact on the long-time stability of the runtime environment. To avoid memory leaks, ComChannels should not be opened implicitly, like
+
{{Important| '''Long-time running procedures''' should note that the OTX runtime will close open ComChannels solely via the CloseComChannel activity! This has an impact on the long-time stability of the runtime environment. To avoid '''memory leaks''', ComChannels '''should not''' be opened '''implicitly''', like
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
ExecuteDiagService(CreateDiagServiceByName(GetComChannel("LL_AirbaUDS","",false), "DiagnServi_ReadDataByIdentECUIdent"), ...);
 
ExecuteDiagService(CreateDiagServiceByName(GetComChannel("LL_AirbaUDS","",false), "DiagnServi_ReadDataByIdentECUIdent"), ...);
 
</syntaxhighlight>
 
</syntaxhighlight>
because the resources can be released only after completion of runtime execution. Better use:
+
because the resources cannot be released until the completion of runtime execution. Better use:
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
<syntaxhighlight lang="java" enclose="div" style="font-size: medium;">
 
ComChannel comChannel = GetComChannel("LL_AirbaUDS","",false);
 
ComChannel comChannel = GetComChannel("LL_AirbaUDS","",false);
Line 11: Line 11:
 
CloseComChannel(comChannel);
 
CloseComChannel(comChannel);
 
</syntaxhighlight>
 
</syntaxhighlight>
 +
For the '''short-dated execution''' of procedures, this is of '''minor importance'''!
 
}}
 
}}

Revision as of 13:56, 22 October 2014

Exclamation.png Important: Long-time running procedures should note that the OTX runtime will close open ComChannels solely via the CloseComChannel activity! This has an impact on the long-time stability of the runtime environment. To avoid memory leaks, ComChannels should not be opened implicitly, like
ExecuteDiagService(CreateDiagServiceByName(GetComChannel("LL_AirbaUDS","",false), "DiagnServi_ReadDataByIdentECUIdent"), ...);

because the resources cannot be released until the completion of runtime execution. Better use:

ComChannel comChannel = GetComChannel("LL_AirbaUDS","",false);
DiagService diagService = CreateDiagServiceByName(comChannel, "DiagnServi_ReadDataByIdentECUIdent"));
ExecuteDiagService(diagService, ...);
...
CloseComChannel(comChannel);

For the short-dated execution of procedures, this is of minor importance!