Pergunta

I wrote an application to transfer records as reading from Sybase Ase database and writing a new created local Sybase Asa database. There are nearly 110.000 records to transfer.

On my local machine, application runs successfully (Windows7- 32bit - 3GB ram) but on development server(Windows Server 2008 - 64bit - 8GB ram), Im getting "OUT OF MEMORY" error when my ;

  • record count is ~ 40.000 and "working set- private" ~ 1.800.000kb(2,8gb)
  • gc total memory incrementation is stabile

Here my log flows;

  • Verbose Working set - Private: 507948K, GC GetTotalMemory: 49229720
  • Verbose Working set - Private: 918620K, GC GetTotalMemory: 51377000
  • Verbose Working set - Private: 1328568K, GC GetTotalMemory: 52245316
  • Verbose Working set - Private: 1739128K, GC GetTotalMemory: 52978364
  • Verbose Working set - Private: 1813940K, GC GetTotalMemory: 51567670
  • out of memory -

And also this batch file for creating Local sybase asa database;

set dbToolsPath=%1
set dbDirectory=%2
set scriptsDirectory=%3
set dbNameWOExtension=%4

REM Add trailing back slashes if necessary
IF NOT %dbToolsPath:~-1%==\ SET dbToolsPath=%dbToolsPath%\
IF NOT %dbDirectory:~-1%==\ SET dbDirectory=%dbDirectory%\
IF NOT %scriptsDirectory:~-1%==\ SET scriptsDirectory=%scriptsDirectory%\

set mfgDBFilePath=%dbDirectory%%dbNameWOExtension%.db
set mfgDBLogFilePath=%dbDirectory%%dbNameWOExtension%.log
REM Following four lines can be moved to code
attrib -R       %mfgDBFilePath%
del             %mfgDBFilePath%
attrib -R       %mfgDBLogFilePath%
del         %mfgDBLogFilePath%

REM TODO: Add explanation about the switches
cd /d %scriptsDirectory%
**%dbToolsPath%dbinit.exe -n -p 4096 -z 1252LATIN1 %mfgDBFilePath%
%dbToolsPath%dbspawn.exe -p dbeng10 -n WfDBServer %mfgDBFilePath%
%dbToolsPath%dbisql.exe -c "eng=WfDBServer;dbn=%dbNameWOExtension%;uid=dba;pwd=sql" -nogui PE_WfDB_MFG.sql
%dbToolsPath%dbstop.exe -c "eng=WfDBServer;uid=dba;pwd=pluto" -y**

These are obtained knowledges but i can not understand why aborted the transfer with this error. Everything is ok on my machine, what can be different on server? Where i must look for problem? Also how i must comment the incrementation of private?

Foi útil?

Solução

Most Probably the issue is due to wrong Platform (x86 I guess) in project Configuration. You can select AnyCPU or x64 as platform and rebuild the application.See the marked answer .NET Out Of Memory Exception - Used 1.3GB but have 16GB installed

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top