Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - JayBee15

Pages: [1]
1
Automation Interface, Add-Ins and Tools / Collection.GetAt(short index)
« on: December 04, 2015, 10:10:38 am »
Question about Collection.GetAt. It expects a short to be passed in, which indicates the maximum size of the Collection would be 32767. Is this assumption correct? And if so, what is someone to do if the Collection has more than that number? Will it crack even trying to build the Collection in the first place?

2
Simon,
>>that Exit wouldn't work unless you had loaded a model
JB: >>A model has been loaded so this is not the scenario

Turns out this is not exactly as stated. There is a part of the code that instantiates a repository then exits it without loading a model. I tested the same code in 12 and the process was cleaned up appropriately.

So here are my findings thus far.

Sparx 10: Instantiate Repository, do nothing else and shut down the code. The EA process is garbage collected properly.
Sparx 11: Do the same as above. The process is left after the program exits and is not garbage collected. Only is destroyed if a model is opened and the Repository is exited.
Sparx12: Do the same as described in the 1st scenario and the process is still left hanging. Add the Repository exit and the process is removed.

The end result of all this is some code needs to be changed in order to get the process to cleanup properly. Suppose it was bad form in the 1st place to leave the Repository object hanging around without cleaning it up. However, there is still an issue still if the code that instantiated the Repository is killed without having a chance to clean up the Repository. This will result in EA processes left out there.

3
Simon,
>>that Exit wouldn't work unless you had loaded a model
A model has been loaded so this is not the scenario

MrWappy,
It is not interacting with any other com service. It is easily reproduced by simply creating a small c# program that creates an instance of EA, loads an existing model, and shuts it all back down.

Thanks to both for your suggestions.

4
The Exit is executed (watching via debugger). Yes to the null.

This only became a problem when the OS was upgraded to Win7 64 bit. Never had this issue until then.

Sparx seems to know there is an issue since they have the code for the forced garbage collection on the Examples and Tips page. Unfortunately this is not doing the trick. I can run the code several times in a row and cause the memory to leak right away.

5
Have an issue with c# code leaving EA processes alive after the code is complete. There is a suggestion this situation happens on the Examples and Tips page and that coding a forced garabge collection will cleanup the released repository instance (via Repository.Exit). This is not working and the EA process still hangs around.
Using Win7 with EA11.
Has anyone else hit this and been able to resolve it? I am not entertaining dumping the contents of all the processes and looking for any that are EA and killing the PID ... that's just terrible brute force form and bad practice. Surely there must be a more elegant way. More than that there is no reason for the EA process to be left in a state that it is not released when the code is complete.

Pages: [1]