Replication Job Failing: The application failed to initialize properly (0xc0000142).

 
Error: The application failed to initialize properly (0xc0000142).
 
Issue: We have SQL server replication is configured for too many databases in single set of publisher and subscriber.
 
Reason: Error 0xc0000142 indicates there is a issue with desktop heap. We are not left with much free heap.
 
Fix:
 
  1.       Increase the heap size by modifying registry followed with server reboot
    1. a) HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management\SessionViewSize (increase the value from 48 to 64, for example)
    2. b) HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\SubSystems\Windows (increase the third value of SharedSection by 256 kilobytes, for example)
  2.       Change the replication agents from running continuously to running on a scheduled basis.
  3.       Change the server location on which the replication agents are running. May be changing from push to pull will help.
  4.        Use separate accounts for the replication agents created for different databases.
 
Note: If job runs under different proxy accounts. For each proxy account, the non-interactive desktop heap for that proxy account will be allocated. For example, the third value of the SharedSection parameter is 512. If you use a proxy account to start a job, the 512 KB desktop heap will be allocated, even if the job itself uses only 10 KB of the desktop heap.
 
 

1 comment: