Memory management in Teamcenter

 

 

 

 

 

 

 

 

 

 

 

 

Memory management in Teamcenter

Let’s look at the format of Teamcenter API’s.

Take example of the following API.

ITK API help provides us a way for managing memory.

Above API takes workspace tag as input and return workspace name as output. First API returns character Array which is depreciated API.

and second API return character pointer value.

I/O/OF 

Input (I):     These characters indicate whether the particular arguments is for input

Output (O): Its for output variable


Could not open FCCJavaClientProxy library


Output freed (OF):  Output-free means that the function allocates space for the returned data and this space should be freed with the MEM_free function. This data should be discarded when no longer needed, by calling MEM_free with the relevant argument.

In short in second API we need to free a_name as it is OF variable. It should be release bypassing the address to the MEM_free function.

If you are using old Teamcenter version i.e below TC10 and using old API’s like WSOM_Ask_name only and its output is of type character array then explicitly we need to set dynamic memory allocation for character array afterwords we can free it.

for name.

char *  a_name[25]=null;

//Dynamic memory allocation of name

name=(char *)MEM_alloc(sizeof(char) * (tc_strlen(testName) + 1));

//After use of name , It needs to be free

mem_free(name);

But in second case, Once you used i.e WSOM_Ask_name2 API a_name needs to be free.


POM Queries in Teamcenter


 

We will more post on PLM TUTORIAL–>Teamcenter Customization in upcoming days.

Kindly provide your valuable comment on below Comment section and also have you any question kindly ask to ASK QUESTION in FORUM. Our Team will try to provide the best workaround.

Kindly subscribe your Email-Id at (https://globalplm.com/) and drop any suggestion/queries to ([email protected]).

Leave a Reply

Your email address will not be published. Required fields are marked *