Out of memory errors resulted in app crash

I keep getting out of memory errors on Toad 5.6…

That result in the various app toolbars turning into big red “X”:

System.OutOfMemoryException

Out of memory.

Stack Trace:

at System.Drawing.Image.FromHbitmap(IntPtr hbitmap, IntPtr hpalette)

at System.Drawing.Image.FromHbitmap(IntPtr hbitmap)

at System.Windows.Forms.ImageList.GetBitmap(Int32 index)

at System.Windows.Forms.ImageList.ImageCollection.get_Item(Int32 index)

at DevExpress.Utils.ImageCollection.GetImageListImage(Object images, Int32
index)

at DevExpress.XtraBars.ViewInfo.BarLinkViewInfo.GetLinkImageCore(BarLinkState
state)

at DevExpress.XtraBars.ViewInfo.BarLinkViewInfo.GetLinkImage(BarLinkState state)

at
DevExpress.XtraBars.Painters.BarLinkPainter.DrawLinkImageCore(BarLinkPaintArgs
e, Rectangle r, BarLinkState state, ImageAttributes attr)

at
DevExpress.XtraBars.Painters.BarLinkPainter.DrawLinkNormalGlyph(BarLinkPaintArgs
e, Boolean lighter)

at DevExpress.XtraBars.Painters.BarLinkPainter.DrawLinkNormal(BarLinkPaintArgs
e)

at
DevExpress.XtraBars.Painters.BarLinkPainter.DrawLinkHorizontal(BarLinkPaintArgs
e)

at DevExpress.XtraBars.Painters.BarLinkPainter.DrawLink(BarLinkPaintArgs e)

at DevExpress.XtraBars.Painters.BarLinkPainter.Draw(GraphicsInfoArgs e,
CustomViewInfo info, Object sourceInfo)

at DevExpress.XtraBars.Painters.BarLinkObjectPainter.DrawObject(ObjectInfoArgs
e)

at DevExpress.Utils.Drawing.ObjectPainter.DrawObject(GraphicsCache cache,
ObjectPainter painter, ObjectInfoArgs e)

at

DevExpress.Utils.Drawing.Animation.XtraAnimator.DrawAnimationHelper(GraphicsCache
cache, ISupportXtraAnimation obj, Object animationId, ObjectPainter painter,
ObjectInfoArgs info, ObjectPainter textPainter, ObjectInfoArgs textInfo)

at

DevExpress.Utils.Drawing.Animation.XtraAnimator.DrawAnimationHelper(GraphicsCache
cache, ISupportXtraAnimation obj, Object animationId, ObjectPainter painter,
ObjectInfoArgs info, DrawTextInvoker drawTextMethod, Object textInfo)

at DevExpress.XtraBars.Painters.BarPainter.DrawLink(GraphicsInfoArgs e,
BarControlViewInfo viewInfo, BarLinkViewInfo item)

at DevExpress.XtraBars.Painters.BarPainter.Draw(GraphicsInfoArgs e,
CustomViewInfo info, Object sourceInfo)

at DevExpress.XtraBars.Controls.CustomControl.DirectDraw(PaintEventArgs e)

at DevExpress.XtraBars.Controls.CustomControl.OnPaint(PaintEventArgs e)

at DevExpress.XtraBars.Controls.CustomBarControl.OnPaint(PaintEventArgs e)

at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16
layer, Boolean disposeEventArgs)

at System.Windows.Forms.Control.WmPaint(Message& m)

at System.Windows.Forms.Control.WndProc(Message& m)

at DevExpress.XtraBars.Controls.DockedBarControl.WndProc(Message& msg)

at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr
wparam, IntPtr lparam)

It almost always happens after I go to run a SQL statement. In this case I was
running this command:

Eventually it just crashed:

The process just crashed after that … so I couldn’t debug or produce
the support package.

Darren

image001.png


Darren,

Please take a look in your settings and say what is about ‘Poll service
status in connection list’ option under Database\General section. Is it
checked or not?

We discovered that it may lead to such issues on some environments if It
checked.

regards,

Alexander Maximov

Darren,

Please take a look in your settings and say what is about ‘Poll service
status in connection list’ option under Database\General section. Is it
checked or not?

We discovered that it may lead to such issues on some environments if It
checked.

regards,

Alexander Maximov

It was checked. I’ve un-checked it … will let you know if it helps
or not.

Darren

It was checked. I’ve un-checked it … will let you know if it helps
or not.

Darren

Thanks, keep me updated please. I’m trying to understand how to reproduce
this since users which reported about this to Support can’t reproduce it
on demand or provide any specific steps.

BTW, will be appreciated for any help with identifying your steps before the
crash.

regards,

Alexander Maximov

Thanks, keep me updated please. I’m trying to understand how to reproduce
this since users which reported about this to Support can’t reproduce it
on demand or provide any specific steps.

BTW, will be appreciated for any help with identifying your steps before the
crash.

regards,

Alexander Maximov

Sure, problem is you pretty much have to be working in Toad for at least a few
hours… using various screens. I can say that the screens open were limited
to:

1 - Connection Manager,

1 - Object Explorer,

1 - Database Explorer

5 + Editors (at least 5+ open):

, each editor with a Results window, with these tabs displayed:

1 Results window for each editor including tabs like Result Sets, Messages,
Execution Plan, Pivot & Chart (although I never set the focus to those last
two).

And an Object Details Window:

There were no other windows opened during this session this day. It was limited
to those.

Every time this has happed I’ve always been recently copying data to the
clipboard – be it from results sets or from export as SQL scripts to the
clipboard.

Usually the out of memory happens after running a query… in this case I
was running this query:

SELECT 'SELECT distinct ''' + table_Name + ''' as TableName, ''' + COLUMN_NAME +
''' as ColumnName, ' + quotename (Column_Name) + ' as Value FROM ' + Quotename
(Table_name) + ' UNION ALL '

FROM INFORMATION_SCHEMA.columns WHERE column_name like 'Currency%' and
column_Name not like '%am%' and Table_Name not in ( SELECT Table_Name FROM
Information_schema.tables WHERE TABLE_TYPE = 'VIEW' )

But what the query contains isn’t important… it just seems to be the
act of running it and the system trying to draw another results set that
triggers it off.

One other thing to note: I almost always have at least one or more Remote
Desktop sessions open while I’m working. When this most recent crash
happened I had one open, but locked Remote Desktop session open. Not sure if
it’s related or not. Other apps open on the machine: Outlook 2010, Access
2003, Word 2010, VB6, Excel 2010, SSMS 2008 R2, other stuff.

The hardware has i7 with Hyperthreading so OS sees 8 CPUs, 8 GB RAM – of
which about 3GB are free. So it’s not like I’m on a slow machine or
one without RAM. I was only connected to one SQL instance on a different server
when the latest crash happened – so only one open connection, not multiple
connections.

Hope that helps…

Darren

Sure, problem is you pretty much have to be working in Toad for at least a few
hours… using various screens. I can say that the screens open were limited
to:

1 - Connection Manager,

1 - Object Explorer,

1 - Database Explorer

5 + Editors (at least 5+ open):

, each editor with a Results window, with these tabs displayed:

1 Results window for each editor including tabs like Result Sets, Messages,
Execution Plan, Pivot & Chart (although I never set the focus to those last
two).

And an Object Details Window:

There were no other windows opened during this session this day. It was limited
to those.

Every time this has happed I’ve always been recently copying data to the
clipboard – be it from results sets or from export as SQL scripts to the
clipboard.

Usually the out of memory happens after running a query… in this case I
was running this query:

SELECT 'SELECT distinct ''' + table_Name + ''' as TableName, ''' + COLUMN_NAME +
''' as ColumnName, ' + quotename (Column_Name) + ' as Value FROM ' + Quotename
(Table_name) + ' UNION ALL '

FROM INFORMATION_SCHEMA.columns WHERE column_name like 'Currency%' and
column_Name not like '%am%' and Table_Name not in ( SELECT Table_Name FROM
Information_schema.tables WHERE TABLE_TYPE = 'VIEW' )

But what the query contains isn’t important… it just seems to be the
act of running it and the system trying to draw another results set that
triggers it off.

One other thing to note: I almost always have at least one or more Remote
Desktop sessions open while I’m working. When this most recent crash
happened I had one open, but locked Remote Desktop session open. Not sure if
it’s related or not. Other apps open on the machine: Outlook 2010, Access
2003, Word 2010, VB6, Excel 2010, SSMS 2008 R2, other stuff.

The hardware has i7 with Hyperthreading so OS sees 8 CPUs, 8 GB RAM – of
which about 3GB are free. So it’s not like I’m on a slow machine or
one without RAM. I was only connected to one SQL instance on a different server
when the latest crash happened – so only one open connection, not multiple
connections.

Hope that helps…

Darren

Sure, problem is you pretty much have to be working in Toad for at least a few
hours… using various screens. I can say that the screens open were limited
to:

1 - Connection Manager,

1 - Object Explorer,

1 - Database Explorer

5 + Editors (at least 5+ open):

, each editor with a Results window, with these tabs displayed:

1 Results window for each editor including tabs like Result Sets, Messages,
Execution Plan, Pivot & Chart (although I never set the focus to those last
two).

And an Object Details Window:

There were no other windows opened during this session this day. It was limited
to those.

Every time this has happed I’ve always been recently copying data to the
clipboard – be it from results sets or from export as SQL scripts to the
clipboard.

Usually the out of memory happens after running a query… in this case I
was running this query:

SELECT 'SELECT distinct ''' + table_Name + ''' as TableName, ''' + COLUMN_NAME +
''' as ColumnName, ' + quotename (Column_Name) + ' as Value FROM ' + Quotename
(Table_name) + ' UNION ALL '

FROM INFORMATION_SCHEMA.columns WHERE column_name like 'Currency%' and
column_Name not like '%am%' and Table_Name not in ( SELECT Table_Name FROM
Information_schema.tables WHERE TABLE_TYPE = 'VIEW' )

But what the query contains isn’t important… it just seems to be the
act of running it and the system trying to draw another results set that
triggers it off.

One other thing to note: I almost always have at least one or more Remote
Desktop sessions open while I’m working. When this most recent crash
happened I had one open, but locked Remote Desktop session open. Not sure if
it’s related or not. Other apps open on the machine: Outlook 2010, Access
2003, Word 2010, VB6, Excel 2010, SSMS 2008 R2, other stuff.

The hardware has i7 with Hyperthreading so OS sees 8 CPUs, 8 GB RAM – of
which about 3GB are free. So it’s not like I’m on a slow machine or
one without RAM. I was only connected to one SQL instance on a different server
when the latest crash happened – so only one open connection, not multiple
connections.

Hope that helps…

Darren

Sure, problem is you pretty much have to be working in Toad for at least a few
hours… using various screens. I can say that the screens open were limited
to:

1 - Connection Manager,

1 - Object Explorer,

1 - Database Explorer

5 + Editors (at least 5+ open):

, each editor with a Results window, with these tabs displayed:

1 Results window for each editor including tabs like Result Sets, Messages,
Execution Plan, Pivot & Chart (although I never set the focus to those last
two).

And an Object Details Window:

There were no other windows opened during this session this day. It was limited
to those.

Every time this has happed I’ve always been recently copying data to the
clipboard – be it from results sets or from export as SQL scripts to the
clipboard.

Usually the out of memory happens after running a query… in this case I
was running this query:

SELECT 'SELECT distinct ''' + table_Name + ''' as TableName, ''' + COLUMN_NAME +
''' as ColumnName, ' + quotename (Column_Name) + ' as Value FROM ' + Quotename
(Table_name) + ' UNION ALL '

FROM INFORMATION_SCHEMA.columns WHERE column_name like 'Currency%' and
column_Name not like '%am%' and Table_Name not in ( SELECT Table_Name FROM
Information_schema.tables WHERE TABLE_TYPE = 'VIEW' )

But what the query contains isn’t important… it just seems to be the
act of running it and the system trying to draw another results set that
triggers it off.

One other thing to note: I almost always have at least one or more Remote
Desktop sessions open while I’m working. When this most recent crash
happened I had one open, but locked Remote Desktop session open. Not sure if
it’s related or not. Other apps open on the machine: Outlook 2010, Access
2003, Word 2010, VB6, Excel 2010, SSMS 2008 R2, other stuff.

The hardware has i7 with Hyperthreading so OS sees 8 CPUs, 8 GB RAM – of
which about 3GB are free. So it’s not like I’m on a slow machine or
one without RAM. I was only connected to one SQL instance on a different server
when the latest crash happened – so only one open connection, not multiple
connections.

Hope that helps…

Darren

Sure, problem is you pretty much have to be working in Toad for at least a few
hours… using various screens. I can say that the screens open were limited
to:

1 - Connection Manager,

1 - Object Explorer,

1 - Database Explorer

5 + Editors (at least 5+ open):

, each editor with a Results window, with these tabs displayed:

1 Results window for each editor including tabs like Result Sets, Messages,
Execution Plan, Pivot & Chart (although I never set the focus to those last
two).

And an Object Details Window:

There were no other windows opened during this session this day. It was limited
to those.

Every time this has happed I’ve always been recently copying data to the
clipboard – be it from results sets or from export as SQL scripts to the
clipboard.

Usually the out of memory happens after running a query… in this case I
was running this query:

SELECT 'SELECT distinct ''' + table_Name + ''' as TableName, ''' + COLUMN_NAME +
''' as ColumnName, ' + quotename (Column_Name) + ' as Value FROM ' + Quotename
(Table_name) + ' UNION ALL '

FROM INFORMATION_SCHEMA.columns WHERE column_name like 'Currency%' and
column_Name not like '%am%' and Table_Name not in ( SELECT Table_Name FROM
Information_schema.tables WHERE TABLE_TYPE = 'VIEW' )

But what the query contains isn’t important… it just seems to be the
act of running it and the system trying to draw another results set that
triggers it off.

One other thing to note: I almost always have at least one or more Remote
Desktop sessions open while I’m working. When this most recent crash
happened I had one open, but locked Remote Desktop session open. Not sure if
it’s related or not. Other apps open on the machine: Outlook 2010, Access
2003, Word 2010, VB6, Excel 2010, SSMS 2008 R2, other stuff.

The hardware has i7 with Hyperthreading so OS sees 8 CPUs, 8 GB RAM – of
which about 3GB are free. So it’s not like I’m on a slow machine or
one without RAM. I was only connected to one SQL instance on a different server
when the latest crash happened – so only one open connection, not multiple
connections.

Hope that helps…

Darren

Hi Darren,

Do you have anything new on this subject? How it looks with unchecked
‘Poll service status…’ option on your side?

Another question I’m interested in – how many objects in your
databases? Hundreds, thousands? Do you see any relation between size of the DB
(or amount of objects) and frequency of this issue?

regards,

Alexander Maximov

Hi Darren,

Do you have anything new on this subject? How it looks with unchecked
‘Poll service status…’ option on your side?

Another question I’m interested in – how many objects in your
databases? Hundreds, thousands? Do you see any relation between size of the DB
(or amount of objects) and frequency of this issue?

regards,

Alexander Maximov

Hi Darren,

Do you have anything new on this subject? How it looks with unchecked
‘Poll service status…’ option on your side?

Another question I’m interested in – how many objects in your
databases? Hundreds, thousands? Do you see any relation between size of the DB
(or amount of objects) and frequency of this issue?

regards,

Alexander Maximov

Hi Darren,

Do you have anything new on this subject? How it looks with unchecked
‘Poll service status…’ option on your side?

Another question I’m interested in – how many objects in your
databases? Hundreds, thousands? Do you see any relation between size of the DB
(or amount of objects) and frequency of this issue?

regards,

Alexander Maximov

Hi Darren,

Do you have anything new on this subject? How it looks with unchecked
‘Poll service status…’ option on your side?

Another question I’m interested in – how many objects in your
databases? Hundreds, thousands? Do you see any relation between size of the DB
(or amount of objects) and frequency of this issue?

regards,

Alexander Maximov

Hi all,

I got this error many times today before discovering that I had the ‘connection properties’ window open. I hope that was the source of the problem. Otherwise, I was querying a table with ~60K rows and ~100 columns, so out of memory may be in fact the problem. (Task manager reported, however, that I still had lots of free memory).

I will post again if the problem recurs.

2 July 2013, a few hours later.

Problem persists. I checked the poll setting and it was un-checked by default.

The query completes OK, the result grid shows. But when I attempt to export the result set, I get the out of memory exception. After that it’s necessary to kill Toad via the Task Manager.

2 July 2013, 2-3 hours later

OK, got it working. The trick was to use the button ‘export to Excel instance’, instead of selecting the rows of the grid and then doing it from there. Perhaps the attempt to select such a large result set caused the error (though it shouldn’t have). In any case, now I know how to do it.

I’m glad you figure it out.

Thanks for sharing your experience!