DocumentUltimateConfigurationMaximumStackSize Property

Gets or sets a value that specifies maximum stack size of threads, in bytes, which should be used when necessary. Note that this should be set only if you get StackOverflowException for some document conversions (e.g. PDFs with signed certificates). When set, if current thread's stack size is lower than the value, a new thread will be created with the value and the conversion will be done inside this thread to prevent StackOverflowException. The default is 0, which means disabled.

Definition

Namespace: GleamTech.DocumentUltimate
Assembly: GleamTech.DocumentUltimate (in GleamTech.DocumentUltimate.dll) Version: 7.2.0
C#
public int MaximumStackSize { get; set; }

Property Value

Int32

Remarks

The default CLR stack size is 1MB for x86 process and 4MB for x64 process (not with AnyCPU even Environment.Is64BitProcess is true, it comes as 1MB). However for ASP.NET applications, this limit is reduced by IIS; in Windows Server 2008 and higher, the maximum stack size of a thread running on 32-bit version of IIS is 256 KB, and on an x64 server is 512 KB. Reference: https://support.microsoft.com/en-us/help/932909/by-default-the-maximum-stack-size-of-a-thread-that-is-created-in-a-nat

Example

C#
DocumentUltimateConfiguration.Current.MaximumStackSize = 1024 * 1024; //1 MB (1048576 bytes)

DocumentUltimateConfiguration.Current.MaximumStackSize = 4 * 1024 * 1024; //4 MB (4194304 bytes)
XML
<!-- Setting MaximumStackSize to 1MB in <appSettings> tag of Web.config -->
<appSettings>
  <add key="DocumentUltimate:MaximumStackSize" value="1048576"/>
</appSettings>

<!-- Setting MaximumStackSize to 4MB in <appSettings> tag of Web.config -->
<appSettings>
  <add key="DocumentUltimate:MaximumStackSize" value="4194304"/>
</appSettings>

See Also