My app is running on a windows server 2019, mapguide 3.1.2, Fusion Viewer
and postgresql 11.5. It keeps refreshing the map on a time basis (last
Period time 1 hour, interval 5 minutes) every 10 seconds filters some
layers. After running several hours (more than 30 hours) it hangs and I got
pink screen. I switched on every mapguide log, but I can't find the reason
in these logs or in the event viewer.
Might be worth looking into making sure you actually call Dispose on the
MgService you create. Also depending on what else you're doing, I'm guessing
you might have some MgByteReader and the likes that might not get closed and
Mapguide also isn't "hung" when the pink map shows up, typically Something
goes wrong with the application pool in IIS and it stops properly
communicating with the Mapguide service. Typically a restart of the app pool
brings everything back fine. Which leads me to think the issue might be with
proper memory management.
As far as I am aware/remember, Mapguide's API in .NET isn't really pure .NET
and is actually a SWIG wrapper over the C++ COM API. So some of the classes
are VERY SENSITIVE about getting properly disposed and closed in your code.
Your code could be making your application pool run out of assignable object
references from the C++ API.
So all in all, try not to declare any "Mg" classes you don't intend to use
and make sure that when you do, you dispose them. The most important ones
are any of the Mg*Reader classes, for reading features, resources, etc.
Likewise for MgService classes.
Thanks to your response.
I put in dispose all the Mg elements, after using them, and I still got the
error at the siteconnection open. I have this code running at a MapServer
Infrastructure 2017 without a problem (and not disposing Mg classes).
Did you update your binaries for Mapguide when deploying against 3.1.2? AIMS
2017's dlls are for Mapguide 18.104.22.16801, which isn't the same version.
Sometimes I've seen some issues when using the wrong version of the Mapguide
So make sure the content of your BIN folder has the dlls from 3.1.2.
The binaries are updated, I copied the dlls from the mapguide 3.1.2
installation. The error is related to the mapguide configuration file. I
inspected the original file webconfig.ini enconding and it is US-ASCII not
UTF-8, so I changed it to UTF-8. I am performing a teste right now. I will
wait to see how it goes.
PS: I also changed the encodig to UTF-8 of the following files: