I'm keeping writing on this subject, hoping that somebody find a solution.
Based on several experiments, I came to think that problems with FastCGI & wkPooled (value for property Kind of TFPWebModule) are related with memories allocated are not released.
IIS of Windows (in my case) creates new instance of web app, if there are new requests while previous instance is still running processing previous request. After predefined idle time (default is 5 minutes in case of IIS), the instance is released.
Problem is this does not seem to release allocated within the application. That is, destructor Destroy is not called. For example, I tried followings.
unit web1;
interface
...
implementation
...
initialization
Log('initialization called'); // procedure Log just write the text string to a file.
finalization
Log('finalization called');
end.
Here, initialization is called several times --- at first access, there is a log.
After 10 minutes of no access, I access to the web server again, and there is another log, but only initialization. So the application must have been dumped and re-created. But 'finalization' is never logged.
I think the same happens at the web module level --- when it is set as wkPooled. I can see logs of DataModuleCreate, but not of DataModuleDestroy.
These are just guesses anyway. But if there are some methods to solve these problems, please let me know so that I can test it.