Hata:
Sunucularda Java heap size'ı standart olarak bir değer atanmaktadır fakat bu bazı sistemler için yetersiz olduğunda out of memory hataları alınmakta, alınan hatalar aşağıdaki gibidir.
2015-10-27 16:21:49.2881|ERROR|Worker.WorkItem|73|Exception occured while processing workitem 44d80bf3-9c26-455a-ac2f-db54f3710361.|System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown. at Microsoft.Win32.Win32Native.OpenProcessToken(IntPtr ProcessToken, TokenAccessLevels DesiredAccess, SafeTokenHandle& TokenHandle) at System.Security.Principal.WindowsIdentity.GetCurrentProcessToken(TokenAccessLevels desiredAccess, Int32& hr) at System.Security.Principal.WindowsIdentity.GetCurrentToken(TokenAccessLevels desiredAccess, Boolean threadOnly, Boolean& isImpersonating, Int32& hr) at System.Security.Principal.WindowsIdentity.GetCurrentInternal(TokenAccessLevels desiredAccess, Boolean threadOnly) at System.Security.Principal.WindowsIdentity.GetCurrent() at System.Data.ProviderBase.DbConnectionPoolIdentity.GetCurrentWindowsIdentity() at System.Data.ProviderBase.DbConnectionPoolIdentity.GetCurrent()
Çözüm:
Bu tarz bir sorunla karşılaşmamak için makinedeki memory'nin 1/4'ünün Java heap size'ına ayrılması önerilmektedir. Bu işlemi yapmak için aşağıdaki adımları takip edin:
- BaseX'in kurulu olduğu dizindeki bin klasörüne girilir,
- basexserver.bat dosyası text editor ile açılır,
- Resimde sarı ile işaretlenen yere heap size değeri girilir
Girilmesi gereken format -Xmx[boyut][birim] şeklindedir. Megabyte için m veya M, gigabyte g veya G harfi girilmelidir. "MB" veya "GB" şeklindeki yazımlar kabul edilmemektedir.
Girilebilecek maksimum memory miktarı 2 GB civarıdır(2048 mb).
Daha detaylı bilgi için: java memory heap size control