Home All Groups Group Topic Archive Search About

Out of Memory Problem in VB 6.0/SQL Server 2000 Application.

Author
15 Sep 2005 6:17 PM
Peri
Dear All,

I have developed an application which is memory hungry. All the information
are stored in the memory (Using Array of Structures) and also in the SQL
server database. All the process will be done in the arrays and the final
update will be done in the SQL server database and I take care that both of
them are in synch.

Now the problem is when I tested the application under load it is giving
"Out of Memory". I am having around 10 arrays in which each array has more
than 60000 entries.

The Machine configuration is

Xeon 3.0 Processor (Server Mother board) with 4 GB DDR RAM with Windows 2000
Server (OS) and SQL server 2000 installed.

The memory used by my application is around 267 MB and the memory used by
sql server is aroung 497 MB and the total memory used is around 900 MB
including all the other Windows processes. Other than this, no other process
are running in that machine.

Can anyone please guide me on why this error is coming even though I have
sufficient RAM (4 GB RAM) ?

--
Thanks and Regards,

Peri

Author
15 Sep 2005 6:46 PM
JT
It's probably your application (not SQL Server) that is throwing the Out of
Memory error. However ...
How to configure memory for more than 2 GB in SQL Server
http://support.microsoft.com/kb/274750/

If you must perform your data transformations on the client side, then pull
the data into an ADO recordset instead of an array.
Types of Cursors
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbegvb/html/whycursorsareimportantinado.asp
Some Practical Cursor Tips
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsentpro/html/veconkeysetdrivencursors.asp

Show quote
"Peri" <lp***@CSPL.com> wrote in message
news:eMus7GiuFHA.908@tk2msftngp13.phx.gbl...
> Dear All,
>
> I have developed an application which is memory hungry. All the
> information
> are stored in the memory (Using Array of Structures) and also in the SQL
> server database. All the process will be done in the arrays and the final
> update will be done in the SQL server database and I take care that both
> of
> them are in synch.
>
> Now the problem is when I tested the application under load it is giving
> "Out of Memory". I am having around 10 arrays in which each array has more
> than 60000 entries.
>
> The Machine configuration is
>
> Xeon 3.0 Processor (Server Mother board) with 4 GB DDR RAM with Windows
> 2000
> Server (OS) and SQL server 2000 installed.
>
> The memory used by my application is around 267 MB and the memory used by
> sql server is aroung 497 MB and the total memory used is around 900 MB
> including all the other Windows processes. Other than this, no other
> process
> are running in that machine.
>
> Can anyone please guide me on why this error is coming even though I have
> sufficient RAM (4 GB RAM) ?
>
> --
> Thanks and Regards,
>
> Peri
>
>
Author
16 Sep 2005 3:30 AM
Peri
Is there any restriction in VB for using Arrays ?

--
Thanks and Regards,

Peri
"JT" <some***@microsoft.com> wrote in message
news:Oi6EhYiuFHA.3556@TK2MSFTNGP12.phx.gbl...
> It's probably your application (not SQL Server) that is throwing the Out
of
> Memory error. However ...
> How to configure memory for more than 2 GB in SQL Server
> http://support.microsoft.com/kb/274750/
>
> If you must perform your data transformations on the client side, then
pull
> the data into an ADO recordset instead of an array.
> Types of Cursors
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbegvb/htm
l/whycursorsareimportantinado.asp
> Some Practical Cursor Tips
>
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsentpro/ht
ml/veconkeysetdrivencursors.asp
Show quote
>
> "Peri" <lp***@CSPL.com> wrote in message
> news:eMus7GiuFHA.908@tk2msftngp13.phx.gbl...
> > Dear All,
> >
> > I have developed an application which is memory hungry. All the
> > information
> > are stored in the memory (Using Array of Structures) and also in the SQL
> > server database. All the process will be done in the arrays and the
final
> > update will be done in the SQL server database and I take care that both
> > of
> > them are in synch.
> >
> > Now the problem is when I tested the application under load it is giving
> > "Out of Memory". I am having around 10 arrays in which each array has
more
> > than 60000 entries.
> >
> > The Machine configuration is
> >
> > Xeon 3.0 Processor (Server Mother board) with 4 GB DDR RAM with Windows
> > 2000
> > Server (OS) and SQL server 2000 installed.
> >
> > The memory used by my application is around 267 MB and the memory used
by
> > sql server is aroung 497 MB and the total memory used is around 900 MB
> > including all the other Windows processes. Other than this, no other
> > process
> > are running in that machine.
> >
> > Can anyone please guide me on why this error is coming even though I
have
> > sufficient RAM (4 GB RAM) ?
> >
> > --
> > Thanks and Regards,
> >
> > Peri
> >
> >
>
>
Author
16 Sep 2005 12:32 PM
JT
The hardware and OS will impose a restriction in the form of available
memory. If you set the CursorLocation of the recordset to Server, then
records will be paged in and out from the application as needed, so it uses
less memory on the client.

Show quote
"Peri" <lp***@CSPL.com> wrote in message
news:OLWDM8muFHA.2504@tk2msftngp13.phx.gbl...
> Is there any restriction in VB for using Arrays ?
>
> --
> Thanks and Regards,
>
> Peri
> "JT" <some***@microsoft.com> wrote in message
> news:Oi6EhYiuFHA.3556@TK2MSFTNGP12.phx.gbl...
>> It's probably your application (not SQL Server) that is throwing the Out
> of
>> Memory error. However ...
>> How to configure memory for more than 2 GB in SQL Server
>> http://support.microsoft.com/kb/274750/
>>
>> If you must perform your data transformations on the client side, then
> pull
>> the data into an ADO recordset instead of an array.
>> Types of Cursors
>>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbegvb/htm
> l/whycursorsareimportantinado.asp
>> Some Practical Cursor Tips
>>
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsentpro/ht
> ml/veconkeysetdrivencursors.asp
>>
>> "Peri" <lp***@CSPL.com> wrote in message
>> news:eMus7GiuFHA.908@tk2msftngp13.phx.gbl...
>> > Dear All,
>> >
>> > I have developed an application which is memory hungry. All the
>> > information
>> > are stored in the memory (Using Array of Structures) and also in the
>> > SQL
>> > server database. All the process will be done in the arrays and the
> final
>> > update will be done in the SQL server database and I take care that
>> > both
>> > of
>> > them are in synch.
>> >
>> > Now the problem is when I tested the application under load it is
>> > giving
>> > "Out of Memory". I am having around 10 arrays in which each array has
> more
>> > than 60000 entries.
>> >
>> > The Machine configuration is
>> >
>> > Xeon 3.0 Processor (Server Mother board) with 4 GB DDR RAM with Windows
>> > 2000
>> > Server (OS) and SQL server 2000 installed.
>> >
>> > The memory used by my application is around 267 MB and the memory used
> by
>> > sql server is aroung 497 MB and the total memory used is around 900 MB
>> > including all the other Windows processes. Other than this, no other
>> > process
>> > are running in that machine.
>> >
>> > Can anyone please guide me on why this error is coming even though I
> have
>> > sufficient RAM (4 GB RAM) ?
>> >
>> > --
>> > Thanks and Regards,
>> >
>> > Peri
>> >
>> >
>>
>>
>
>
Author
16 Sep 2005 6:43 PM
Peri
I am not using recorsdet at all. I am using only arrays. Can you please help
me out in this.

--
Thanks and Regards,

Peri
Show quote
"JT" <some***@microsoft.com> wrote in message
news:#tuQfsruFHA.2568@TK2MSFTNGP15.phx.gbl...
> The hardware and OS will impose a restriction in the form of available
> memory. If you set the CursorLocation of the recordset to Server, then
> records will be paged in and out from the application as needed, so it
uses
> less memory on the client.
>
> "Peri" <lp***@CSPL.com> wrote in message
> news:OLWDM8muFHA.2504@tk2msftngp13.phx.gbl...
> > Is there any restriction in VB for using Arrays ?
> >
> > --
> > Thanks and Regards,
> >
> > Peri
> > "JT" <some***@microsoft.com> wrote in message
> > news:Oi6EhYiuFHA.3556@TK2MSFTNGP12.phx.gbl...
> >> It's probably your application (not SQL Server) that is throwing the
Out
> > of
> >> Memory error. However ...
> >> How to configure memory for more than 2 GB in SQL Server
> >> http://support.microsoft.com/kb/274750/
> >>
> >> If you must perform your data transformations on the client side, then
> > pull
> >> the data into an ADO recordset instead of an array.
> >> Types of Cursors
> >>
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbegvb/htm
> > l/whycursorsareimportantinado.asp
> >> Some Practical Cursor Tips
> >>
> >
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsentpro/ht
Show quote
> > ml/veconkeysetdrivencursors.asp
> >>
> >> "Peri" <lp***@CSPL.com> wrote in message
> >> news:eMus7GiuFHA.908@tk2msftngp13.phx.gbl...
> >> > Dear All,
> >> >
> >> > I have developed an application which is memory hungry. All the
> >> > information
> >> > are stored in the memory (Using Array of Structures) and also in the
> >> > SQL
> >> > server database. All the process will be done in the arrays and the
> > final
> >> > update will be done in the SQL server database and I take care that
> >> > both
> >> > of
> >> > them are in synch.
> >> >
> >> > Now the problem is when I tested the application under load it is
> >> > giving
> >> > "Out of Memory". I am having around 10 arrays in which each array has
> > more
> >> > than 60000 entries.
> >> >
> >> > The Machine configuration is
> >> >
> >> > Xeon 3.0 Processor (Server Mother board) with 4 GB DDR RAM with
Windows
> >> > 2000
> >> > Server (OS) and SQL server 2000 installed.
> >> >
> >> > The memory used by my application is around 267 MB and the memory
used
> > by
> >> > sql server is aroung 497 MB and the total memory used is around 900
MB
> >> > including all the other Windows processes. Other than this, no other
> >> > process
> >> > are running in that machine.
> >> >
> >> > Can anyone please guide me on why this error is coming even though I
> > have
> >> > sufficient RAM (4 GB RAM) ?
> >> >
> >> > --
> >> > Thanks and Regards,
> >> >
> >> > Peri
> >> >
> >> >
> >>
> >>
> >
> >
>
>
Author
16 Sep 2005 9:04 PM
JT
If you must load all this data into a client side array, consider that when
redim is used to add new elements, VB implements the array resize by copying
all the data into a 2nd array, so it temporarily uses twice as much memory.
I suspect this thing probably runs dog slow as well.

Google on:
array and redim and "out of memory" group:*.vb.*

Show quote
"Peri" <lp***@CSPL.com> wrote in message
news:OOc8L6uuFHA.596@TK2MSFTNGP12.phx.gbl...
>I am not using recorsdet at all. I am using only arrays. Can you please
>help
> me out in this.
>
> --
> Thanks and Regards,
>
> Peri
> "JT" <some***@microsoft.com> wrote in message
> news:#tuQfsruFHA.2568@TK2MSFTNGP15.phx.gbl...
>> The hardware and OS will impose a restriction in the form of available
>> memory. If you set the CursorLocation of the recordset to Server, then
>> records will be paged in and out from the application as needed, so it
> uses
>> less memory on the client.
>>
>> "Peri" <lp***@CSPL.com> wrote in message
>> news:OLWDM8muFHA.2504@tk2msftngp13.phx.gbl...
>> > Is there any restriction in VB for using Arrays ?
>> >
>> > --
>> > Thanks and Regards,
>> >
>> > Peri
>> > "JT" <some***@microsoft.com> wrote in message
>> > news:Oi6EhYiuFHA.3556@TK2MSFTNGP12.phx.gbl...
>> >> It's probably your application (not SQL Server) that is throwing the
> Out
>> > of
>> >> Memory error. However ...
>> >> How to configure memory for more than 2 GB in SQL Server
>> >> http://support.microsoft.com/kb/274750/
>> >>
>> >> If you must perform your data transformations on the client side, then
>> > pull
>> >> the data into an ADO recordset instead of an array.
>> >> Types of Cursors
>> >>
>> >
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnbegvb/htm
>> > l/whycursorsareimportantinado.asp
>> >> Some Practical Cursor Tips
>> >>
>> >
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsentpro/ht
>> > ml/veconkeysetdrivencursors.asp
>> >>
>> >> "Peri" <lp***@CSPL.com> wrote in message
>> >> news:eMus7GiuFHA.908@tk2msftngp13.phx.gbl...
>> >> > Dear All,
>> >> >
>> >> > I have developed an application which is memory hungry. All the
>> >> > information
>> >> > are stored in the memory (Using Array of Structures) and also in the
>> >> > SQL
>> >> > server database. All the process will be done in the arrays and the
>> > final
>> >> > update will be done in the SQL server database and I take care that
>> >> > both
>> >> > of
>> >> > them are in synch.
>> >> >
>> >> > Now the problem is when I tested the application under load it is
>> >> > giving
>> >> > "Out of Memory". I am having around 10 arrays in which each array
>> >> > has
>> > more
>> >> > than 60000 entries.
>> >> >
>> >> > The Machine configuration is
>> >> >
>> >> > Xeon 3.0 Processor (Server Mother board) with 4 GB DDR RAM with
> Windows
>> >> > 2000
>> >> > Server (OS) and SQL server 2000 installed.
>> >> >
>> >> > The memory used by my application is around 267 MB and the memory
> used
>> > by
>> >> > sql server is aroung 497 MB and the total memory used is around 900
> MB
>> >> > including all the other Windows processes. Other than this, no other
>> >> > process
>> >> > are running in that machine.
>> >> >
>> >> > Can anyone please guide me on why this error is coming even though I
>> > have
>> >> > sufficient RAM (4 GB RAM) ?
>> >> >
>> >> > --
>> >> > Thanks and Regards,
>> >> >
>> >> > Peri
>> >> >
>> >> >
>> >>
>> >>
>> >
>> >
>>
>>
>
>

AddThis Social Bookmark Button