Re: [twsocket] Unable to create TIcsWndControl hidden window.

2013-04-13 Thread François Piette
>My app uses TWSocket (TSmtpCli) inside TThreads.
>I create 25 TSmtpCli's per TThread. All TSmtpCli instances created inside
TThread Execute. 
>TStmpCli->MultiThreaded set to true. My TThreads have message loops.
>With 5000 SmtpCli's (inside 200 TThreads) I got exception:
>"Unable to create TIcsWndControl hidden window. Error 1158"
>How I can use 4-5K of TSmtpClis in my app ?
>P.s: ICS v7, C++Builder 2007 with all updates, my app uses FastMM and
FastCode.

Error 1158 is "ERROR_NO_MORE_USER_HANDLES: The current process has used all
of its system allowance of handles for Window Manager objects"

You have to reduce the number of handles your application is using, or split
the application into several collaborating separate processes. 
You may also add more memory in Windows because this is a limiting factor.
Running on a Windows Server also helps. It has more resources than a Windows
Workstation version.

Windows has several limits on various types of handles. There is a limit of
10K handles for window handles but ICS-V7 share a single handle between a
lot of TWSockets. Try creating more TSmtpCli per thread.

See this:
http://msdn.microsoft.com/en-us/library/windows/desktop/ms725486(v=vs.85).as
px

Are you sure that your application is not leaking handles ?

-- 
francois.pie...@overbyte.be
Embarcadero MVP
http://www.overbyte.be
http://francois-piette.blogspot.com




--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


Re: [twsocket] Unable to create TIcsWndControl hidden window.

2013-04-12 Thread Angus Robertson - Magenta Systems Ltd
> "Unable to create TIcsWndControl hidden window. Error 1158"
> How I can use 4-5K of TSmtpClis in my app ?

You are probably out of memory. You need a 64-bit server OS for a lot of
connections.  

You can use these APIs to get various memory information about your
application and the PC, to see what is causing your limit: 

GetProcessMemoryInfo, GlobalMemoryStatusEx and GetPerformanceInfo

My web server application logs this lot hourly:

23:00:10 Program Resources: Handles 225, Memory: Working Set 54.0M, Paged
Pool 131K, Non Paged Pool 19.0K, Peak NP Pool 928K
23:00:10 Global Memory Usage: Load 89%; Total Phys 4.00G; Free 432M;
Total Paging 8.17G; Free 4.73G; Total Virt 2.00G; Free 1.91G
23:00:10 Commit Total 3.45G, Commit Limit 179M, Commit Peak 3.81G,
Physical Total 4.00G, Physical Available 432M, System Cache 854M
23:00:10 Kernel Total 342M, Kernel Paged 223M, Kernel Nonpaged 119M,
Total Handle Count 24,671, Total Process Count 70, Total Thread Count 959

Angus








--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be


[twsocket] Unable to create TIcsWndControl hidden window.

2013-04-12 Thread Max Terentiev
Hi,

My app uses TWSocket (TSmtpCli) inside TThreads.

I create 25 TSmtpCli's per TThread. All TSmtpCli instances 
created inside TThread Execute. TStmpCli->MultiThreaded
set to true. My TThreads have message loops.

With 5000 SmtpCli's (inside 200 TThreads) I got exception:

"Unable to create TIcsWndControl hidden window. Error 1158"

How I can use 4-5K of TSmtpClis in my app ?

P.s: ICS v7, C++Builder 2007 with all updates, my app uses
FastMM and FastCode.

Thanx for help !

---
With best regards, Max Terentiev.
Business Software Products.
AMS Development Team.
supp...@bspdev.com


--
To unsubscribe or change your settings for TWSocket mailing list
please goto http://lists.elists.org/cgi-bin/mailman/listinfo/twsocket
Visit our website at http://www.overbyte.be