MOS上有一篇文档,暂时按这个修改为1024
但要重启生效.
Windows: Oracle Net or Connections Via the Listener Fail with TNS-12531 On Windows 64-bit Platform (Doc ID 1384337.1)
In this Document
Symptoms
Changes
Cause
Solution
References
Applies to:
Oracle Net Services - Version 11.2.0.1 to 12.2.0.1 [Release 11.2 to 12.2]
Microsoft Windows x64 (64-bit)
Microsoft Windows x64 (64-bit) - Version: 2008 R2
TNS-12531 TNS: Failed to allocate memory
Symptoms
Attempting to connect via the listener or remotely to a database running on Windows.
The following error is thrown:Getting the error 'TNS-12531: TNS:cannot allocate memory'
It is possible that no other memory related errors are being thrown at the same time.
It is also possible that the error is fleeting or seems to correct itself.
Changes
There are no significant changes in the environment. It is possible that incoming traffic to the listener has increased and caused this error to occur.
Cause
This can be caused by an inadequate setting for Desktop Heap Size. Even if this is a 64-bit OS with high amount of memory, there is still a limitation that generates this error.
Of course, it can also be caused when the memory is actually low. Check the resource consumption at the time of this problem. If there is no apparent memory shortage,
the solution documented here may resolve the issue.
Solution
Check and edit the Desktop Heap size located here in the registry:
Launch regedt32 and go to:
\HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\SubSystems\
In the right pane, click on Windows and pull down Edit then select Modify.
You should see a string that resembles this in its entirety:
%SystemRoot%\system32\csrss.exe ObjectDirectory=\Windows SharedSection=1024,20480,768 Windows=On SubSystemType=Windows ServerDll=basesrv,1 ServerDll=winsrv:UserServerDllInitialization,3 ServerDll=winsrv:ConServerDllInitialization,2 ServerDll=sxssrv,4 ProfileControl=Off MaxRequestThreads=16
Focus on this section:
Windows SharedSection=1024,20480,768
The third argument is the maximum amount of heap memory allocated to non interactive desktops.
Increase this third value and check when the TNS error disappears. There is no optimum value. It
varies on each MS Windows server.
This change in the registry will require a restart of the Windows server in order for the change to take effect.
|