|
List Info
Thread: PRB: Cannot evaluate expression because a thread is stopped at a point where garba
|
|
| PRB: Cannot evaluate expression because
a thread is stopped at a point where
garba |

|
2007-06-20 16:33:06 |
Guys,
I'm getting this in the VS2005 IDE when I try to debug my
code. I'm really
at a loss to figure this one out.
"Cannot evaluate expression because a thread is stopped
at a point where
garbage collection is impossible, possibly because the code
is optimized."
This does not occur until a method with a particular line of
code is
entered. Once this method is entered by the debugger, any
object more
complex than the intrinsic data types such as ints and
strings cause this
error to be displayed.
The methods are as such:
...
//Variables are readable before this line
this.GridHelper.MarContainer = new MarContainer(myGuid,
ThirtyDay,
this.GridHelper.StartDate);
//And after this line
...
public class GridHelper {
public GridHelper(Guid guid, MarType type, DateTime
date){
...
//Variables are readable before this line
Load(guid, type, date, null);
//But not after this line
}
private void Load(Guid guid, MarType type, DateTime
startDate,
TransactionContext transaction){
//Nothing is readable in here except intrinsic data
types
...
//This is the line, that when commented out, keeps the
ability to
display values working
_groups.Load(details, type, startDate);
}
}
_groups is a variable that references a custom class (that
inherits directly
from System.Object) that has no "special"
functionality in it whatsoever.
Any suggestions or ideas?
Thanks,
Mike
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where g |
  United States |
2007-06-21 08:10:05 |
Well, the class referenced by _groups must have a method
called Load. What's in it? Have you tried commenting out
different lines in the Load method to see what no longer
"keeps the ability to display values working"?
At 04:33 PM 6/20/2007, Mike Andrews wrote (in part)
> private void Load(Guid guid, MarType type, DateTime
startDate,
>TransactionContext transaction){
> //Nothing is readable in here except intrinsic data
types
> ...
> //This is the line, that when commented out, keeps
the ability to
>display values working
> _groups.Load(details, type, startDate);
> }
>
>}
>
>_groups is a variable that references a custom class
(that inherits directly
>from System.Object) that has no "special"
functionality in it whatsoever.
J. Merrill / Analytical Software Corp
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where garbage collection |
  United States |
2007-06-21 08:10:05 |
Well, the class referenced by _groups must have a method
called Load. What's in it? Have you tried commenting out
different lines in the Load method to see what no longer
"keeps the ability to display values working"?
At 04:33 PM 6/20/2007, Mike Andrews wrote (in part)
> private void Load(Guid guid, MarType type, DateTime
startDate,
>TransactionContext transaction){
> //Nothing is readable in here except intrinsic data
types
> ...
> //This is the line, that when commented out, keeps
the ability to
>display values working
> _groups.Load(details, type, startDate);
> }
>
>}
>
>_groups is a variable that references a custom class
(that inherits directly
>from System.Object) that has no "special"
functionality in it whatsoever.
J. Merrill / Analytical Software Corp
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where garbage collection |

|
2007-06-21 10:47:08 |
I think I've discovered the issue and after talking with a
Microsoft
technical support rep.
The rep didn't have an answer, but made a reference to the
number of
parameters which led me to look further.
The issue seems to be the total size of all parameters
passed in to the
method.
The "details" parameter in the _groups.Load(...)
method is a struct.
The struct itself is quite large in size with about 30
fields that contain
DataTables, DataRelations and DataRows.
When I converted the struct to a class, the problem
disappeared. It seems
to be that the struct cannot be passed byval like a class
when the size of
the struct is greater than some [unknown] value.
A very weird problem indeed.
Thanks,
Mike
On 6/21/07, J. Merrill <jvm_cop spamcop.net> wrote:
>
> Well, the class referenced by _groups must have a
method called
> Load. What's in it? Have you tried commenting out
different lines in the
> Load method to see what no longer "keeps the
ability to display values
> working"?
>
> At 04:33 PM 6/20/2007, Mike Andrews wrote (in part)
>
> > private void Load(Guid guid, MarType type,
DateTime startDate,
> >TransactionContext transaction){
> > //Nothing is readable in here except intrinsic
data types
> > ...
> > //This is the line, that when commented out,
keeps the ability to
> >display values working
> > _groups.Load(details, type, startDate);
> > }
> >
> >}
> >
> >_groups is a variable that references a custom
class (that inherits
> directly
> >from System.Object) that has no "special"
functionality in it whatsoever.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> J. Merrill / Analytical Software Corp
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where garbage collection |
  Netherlands |
2007-06-21 10:57:39 |
Uh.. A struct is always passed by value (ie. Copied). A
class is passed by reference (just the pointer)... So yeah,
I can imagine copying a struct with the size you describe
could be a problem for the GC.
-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:ADVANCED-DOTNET DISCUSS.DEVELOP.COM] On Behalf Of Mike
Andrews
Sent: Thursday, June 21, 2007 17:47
To: ADVANCED-DOTNET DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] PRB: Cannot evaluate
expression because a thread is stopped at a point where
garbage collection is impossible...
I think I've discovered the issue and after talking with a
Microsoft
technical support rep.
The rep didn't have an answer, but made a reference to the
number of
parameters which led me to look further.
The issue seems to be the total size of all parameters
passed in to the
method.
The "details" parameter in the _groups.Load(...)
method is a struct.
The struct itself is quite large in size with about 30
fields that contain
DataTables, DataRelations and DataRows.
When I converted the struct to a class, the problem
disappeared. It seems
to be that the struct cannot be passed byval like a class
when the size of
the struct is greater than some [unknown] value.
A very weird problem indeed.
Thanks,
Mike
On 6/21/07, J. Merrill <jvm_cop spamcop.net> wrote:
>
> Well, the class referenced by _groups must have a
method called
> Load. What's in it? Have you tried commenting out
different lines in the
> Load method to see what no longer "keeps the
ability to display values
> working"?
>
> At 04:33 PM 6/20/2007, Mike Andrews wrote (in part)
>
> > private void Load(Guid guid, MarType type,
DateTime startDate,
> >TransactionContext transaction){
> > //Nothing is readable in here except intrinsic
data types
> > ...
> > //This is the line, that when commented out,
keeps the ability to
> >display values working
> > _groups.Load(details, type, startDate);
> > }
> >
> >}
> >
> >_groups is a variable that references a custom
class (that inherits
> directly
> >from System.Object) that has no "special"
functionality in it whatsoever.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> J. Merrill / Analytical Software Corp
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where g |

|
2007-06-21 10:47:08 |
I think I've discovered the issue and after talking with a
Microsoft
technical support rep.
The rep didn't have an answer, but made a reference to the
number of
parameters which led me to look further.
The issue seems to be the total size of all parameters
passed in to the
method.
The "details" parameter in the _groups.Load(...)
method is a struct.
The struct itself is quite large in size with about 30
fields that contain
DataTables, DataRelations and DataRows.
When I converted the struct to a class, the problem
disappeared. It seems
to be that the struct cannot be passed byval like a class
when the size of
the struct is greater than some [unknown] value.
A very weird problem indeed.
Thanks,
Mike
On 6/21/07, J. Merrill <jvm_cop spamcop.net> wrote:
>
> Well, the class referenced by _groups must have a
method called
> Load. What's in it? Have you tried commenting out
different lines in the
> Load method to see what no longer "keeps the
ability to display values
> working"?
>
> At 04:33 PM 6/20/2007, Mike Andrews wrote (in part)
>
> > private void Load(Guid guid, MarType type,
DateTime startDate,
> >TransactionContext transaction){
> > //Nothing is readable in here except intrinsic
data types
> > ...
> > //This is the line, that when commented out,
keeps the ability to
> >display values working
> > _groups.Load(details, type, startDate);
> > }
> >
> >}
> >
> >_groups is a variable that references a custom
class (that inherits
> directly
> >from System.Object) that has no "special"
functionality in it whatsoever.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> J. Merrill / Analytical Software Corp
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where g |
  Netherlands |
2007-06-21 10:57:39 |
Uh.. A struct is always passed by value (ie. Copied). A
class is passed by reference (just the pointer)... So yeah,
I can imagine copying a struct with the size you describe
could be a problem for the GC.
-----Original Message-----
From: Discussion of advanced .NET topics.
[mailto:ADVANCED-DOTNET DISCUSS.DEVELOP.COM] On Behalf Of Mike
Andrews
Sent: Thursday, June 21, 2007 17:47
To: ADVANCED-DOTNET DISCUSS.DEVELOP.COM
Subject: Re: [ADVANCED-DOTNET] PRB: Cannot evaluate
expression because a thread is stopped at a point where
garbage collection is impossible...
I think I've discovered the issue and after talking with a
Microsoft
technical support rep.
The rep didn't have an answer, but made a reference to the
number of
parameters which led me to look further.
The issue seems to be the total size of all parameters
passed in to the
method.
The "details" parameter in the _groups.Load(...)
method is a struct.
The struct itself is quite large in size with about 30
fields that contain
DataTables, DataRelations and DataRows.
When I converted the struct to a class, the problem
disappeared. It seems
to be that the struct cannot be passed byval like a class
when the size of
the struct is greater than some [unknown] value.
A very weird problem indeed.
Thanks,
Mike
On 6/21/07, J. Merrill <jvm_cop spamcop.net> wrote:
>
> Well, the class referenced by _groups must have a
method called
> Load. What's in it? Have you tried commenting out
different lines in the
> Load method to see what no longer "keeps the
ability to display values
> working"?
>
> At 04:33 PM 6/20/2007, Mike Andrews wrote (in part)
>
> > private void Load(Guid guid, MarType type,
DateTime startDate,
> >TransactionContext transaction){
> > //Nothing is readable in here except intrinsic
data types
> > ...
> > //This is the line, that when commented out,
keeps the ability to
> >display values working
> > _groups.Load(details, type, startDate);
> > }
> >
> >}
> >
> >_groups is a variable that references a custom
class (that inherits
> directly
> >from System.Object) that has no "special"
functionality in it whatsoever.
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> J. Merrill / Analytical Software Corp
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentor(r) http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where garbage collection |

|
2007-06-21 11:32:19 |
Yes.
And it makes sense now. I just wasn't thinking along those
lines until the
MS guy said something about it and I had time to think about
it for a while.
It's always something. LOL.
I didn't equate the GC having issues with debugger and the
size of the
struct.
On 6/21/07, Paul van Brenk <paul.van.brenk tamtam.nl> wrote:
>
> Uh.. A struct is always passed by value (ie. Copied). A
class is passed by
> reference (just the pointer)... So yeah, I can imagine
copying a struct with
> the size you describe could be a problem for the GC.
>
> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:
> ADVANCED-DOTNET DISCUSS.DEVELOP.COM] On Behalf Of Mike
Andrews
> Sent: Thursday, June 21, 2007 17:47
> To: ADVANCED-DOTNET DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] PRB: Cannot evaluate
expression because a
> thread is stopped at a point where garbage collection
is impossible...
>
> I think I've discovered the issue and after talking
with a Microsoft
> technical support rep.
> The rep didn't have an answer, but made a reference to
the number of
> parameters which led me to look further.
>
> The issue seems to be the total size of all parameters
passed in to the
> method.
> The "details" parameter in the
_groups.Load(...) method is a struct.
> The struct itself is quite large in size with about 30
fields that contain
> DataTables, DataRelations and DataRows.
> When I converted the struct to a class, the problem
disappeared. It seems
> to be that the struct cannot be passed byval like a
class when the size of
> the struct is greater than some [unknown] value.
>
> A very weird problem indeed.
>
> Thanks,
> Mike
>
>
> On 6/21/07, J. Merrill <jvm_cop spamcop.net> wrote:
> >
> > Well, the class referenced by _groups must have a
method called
> > Load. What's in it? Have you tried commenting
out different lines in
> the
> > Load method to see what no longer "keeps the
ability to display values
> > working"?
> >
> > At 04:33 PM 6/20/2007, Mike Andrews wrote (in
part)
> >
> > > private void Load(Guid guid, MarType type,
DateTime startDate,
> > >TransactionContext transaction){
> > > //Nothing is readable in here except
intrinsic data types
> > > ...
> > > //This is the line, that when commented
out, keeps the ability to
> > >display values working
> > > _groups.Load(details, type, startDate);
> > > }
> > >
> > >}
> > >
> > >_groups is a variable that references a custom
class (that inherits
> > directly
> > >from System.Object) that has no
"special" functionality in it
> whatsoever.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > J. Merrill / Analytical Software Corp
> >
> > ===================================
> > This list is hosted by DevelopMentor(r) http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where g |

|
2007-06-21 11:32:19 |
Yes.
And it makes sense now. I just wasn't thinking along those
lines until the
MS guy said something about it and I had time to think about
it for a while.
It's always something. LOL.
I didn't equate the GC having issues with debugger and the
size of the
struct.
On 6/21/07, Paul van Brenk <paul.van.brenk tamtam.nl> wrote:
>
> Uh.. A struct is always passed by value (ie. Copied). A
class is passed by
> reference (just the pointer)... So yeah, I can imagine
copying a struct with
> the size you describe could be a problem for the GC.
>
> -----Original Message-----
> From: Discussion of advanced .NET topics. [mailto:
> ADVANCED-DOTNET DISCUSS.DEVELOP.COM] On Behalf Of Mike
Andrews
> Sent: Thursday, June 21, 2007 17:47
> To: ADVANCED-DOTNET DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] PRB: Cannot evaluate
expression because a
> thread is stopped at a point where garbage collection
is impossible...
>
> I think I've discovered the issue and after talking
with a Microsoft
> technical support rep.
> The rep didn't have an answer, but made a reference to
the number of
> parameters which led me to look further.
>
> The issue seems to be the total size of all parameters
passed in to the
> method.
> The "details" parameter in the
_groups.Load(...) method is a struct.
> The struct itself is quite large in size with about 30
fields that contain
> DataTables, DataRelations and DataRows.
> When I converted the struct to a class, the problem
disappeared. It seems
> to be that the struct cannot be passed byval like a
class when the size of
> the struct is greater than some [unknown] value.
>
> A very weird problem indeed.
>
> Thanks,
> Mike
>
>
> On 6/21/07, J. Merrill <jvm_cop spamcop.net> wrote:
> >
> > Well, the class referenced by _groups must have a
method called
> > Load. What's in it? Have you tried commenting
out different lines in
> the
> > Load method to see what no longer "keeps the
ability to display values
> > working"?
> >
> > At 04:33 PM 6/20/2007, Mike Andrews wrote (in
part)
> >
> > > private void Load(Guid guid, MarType type,
DateTime startDate,
> > >TransactionContext transaction){
> > > //Nothing is readable in here except
intrinsic data types
> > > ...
> > > //This is the line, that when commented
out, keeps the ability to
> > >display values working
> > > _groups.Load(details, type, startDate);
> > > }
> > >
> > >}
> > >
> > >_groups is a variable that references a custom
class (that inherits
> > directly
> > >from System.Object) that has no
"special" functionality in it
> whatsoever.
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> >
> > J. Merrill / Analytical Software Corp
> >
> > ===================================
> > This list is hosted by DevelopMentor(r) http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where garbage collection |

|
2007-06-21 15:24:21 |
Does anyone know the maximum size of a struct that can be
used in the
Framework without having these issues?
Thanks,
Mike
On 6/21/07, Mike Andrews <outdoor.jellyroll gmail.com> wrote:
>
> Yes.
> And it makes sense now. I just wasn't thinking along
those lines until
> the MS guy said something about it and I had time to
think about it for a
> while.
> It's always something. LOL.
> I didn't equate the GC having issues with debugger and
the size of the
> struct.
>
> On 6/21/07, Paul van Brenk <paul.van.brenk tamtam.nl> wrote:
> >
> > Uh.. A struct is always passed by value (ie.
Copied). A class is passed
> > by reference (just the pointer)... So yeah, I can
imagine copying a struct
> > with the size you describe could be a problem for
the GC.
> >
> > -----Original Message-----
> > From: Discussion of advanced .NET topics.
[mailto:
> > ADVANCED-DOTNET DISCUSS.DEVELOP.COM] On
Behalf Of Mike Andrews
> > Sent: Thursday, June 21, 2007 17:47
> > To: ADVANCED-DOTNET DISCUSS.DEVELOP.COM
> > Subject: Re: [ADVANCED-DOTNET] PRB: Cannot
evaluate expression because a
> > thread is stopped at a point where garbage
collection is impossible...
> >
> > I think I've discovered the issue and after
talking with a Microsoft
> > technical support rep.
> > The rep didn't have an answer, but made a
reference to the number of
> > parameters which led me to look further.
> >
> > The issue seems to be the total size of all
parameters passed in to the
> > method.
> > The "details" parameter in the
_groups.Load(...) method is a struct.
> > The struct itself is quite large in size with
about 30 fields that
> > contain
> > DataTables, DataRelations and DataRows.
> > When I converted the struct to a class, the
problem disappeared. It
> > seems
> > to be that the struct cannot be passed byval like
a class when the size
> > of
> > the struct is greater than some [unknown] value.
> >
> > A very weird problem indeed.
> >
> > Thanks,
> > Mike
> >
> >
> > On 6/21/07, J. Merrill <jvm_cop spamcop.net> wrote:
> > >
> > > Well, the class referenced by _groups must
have a method called
> > > Load. What's in it? Have you tried
commenting out different lines in
> > the
> > > Load method to see what no longer "keeps
the ability to display values
> > > working"?
> > >
> > > At 04:33 PM 6/20/2007, Mike Andrews wrote (in
part)
> > >
> > > > private void Load(Guid guid, MarType
type, DateTime startDate,
> > > >TransactionContext transaction){
> > > > //Nothing is readable in here except
intrinsic data types
> > > > ...
> > > > //This is the line, that when
commented out, keeps the ability to
> > > >display values working
> > > > _groups.Load(details, type,
startDate);
> > > > }
> > > >
> > > >}
> > > >
> > > >_groups is a variable that references a
custom class (that inherits
> > > directly
> > > >from System.Object) that has no
"special" functionality in it
> > whatsoever.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > J. Merrill / Analytical Software Corp
> > >
> > > ===================================
> > > This list is hosted by DevelopMentor(r) http://www.develop.com
> > >
> > > View archives and manage your subscription(s)
at
> > > http://discuss.develop.com
> > >
> >
> > ===================================
> > This list is hosted by DevelopMentor(r) http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
> > ===================================
> > This list is hosted by DevelopMentor(r) http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
>
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where g |

|
2007-06-21 15:24:21 |
Does anyone know the maximum size of a struct that can be
used in the
Framework without having these issues?
Thanks,
Mike
On 6/21/07, Mike Andrews <outdoor.jellyroll gmail.com> wrote:
>
> Yes.
> And it makes sense now. I just wasn't thinking along
those lines until
> the MS guy said something about it and I had time to
think about it for a
> while.
> It's always something. LOL.
> I didn't equate the GC having issues with debugger and
the size of the
> struct.
>
> On 6/21/07, Paul van Brenk <paul.van.brenk tamtam.nl> wrote:
> >
> > Uh.. A struct is always passed by value (ie.
Copied). A class is passed
> > by reference (just the pointer)... So yeah, I can
imagine copying a struct
> > with the size you describe could be a problem for
the GC.
> >
> > -----Original Message-----
> > From: Discussion of advanced .NET topics.
[mailto:
> > ADVANCED-DOTNET DISCUSS.DEVELOP.COM] On
Behalf Of Mike Andrews
> > Sent: Thursday, June 21, 2007 17:47
> > To: ADVANCED-DOTNET DISCUSS.DEVELOP.COM
> > Subject: Re: [ADVANCED-DOTNET] PRB: Cannot
evaluate expression because a
> > thread is stopped at a point where garbage
collection is impossible...
> >
> > I think I've discovered the issue and after
talking with a Microsoft
> > technical support rep.
> > The rep didn't have an answer, but made a
reference to the number of
> > parameters which led me to look further.
> >
> > The issue seems to be the total size of all
parameters passed in to the
> > method.
> > The "details" parameter in the
_groups.Load(...) method is a struct.
> > The struct itself is quite large in size with
about 30 fields that
> > contain
> > DataTables, DataRelations and DataRows.
> > When I converted the struct to a class, the
problem disappeared. It
> > seems
> > to be that the struct cannot be passed byval like
a class when the size
> > of
> > the struct is greater than some [unknown] value.
> >
> > A very weird problem indeed.
> >
> > Thanks,
> > Mike
> >
> >
> > On 6/21/07, J. Merrill <jvm_cop spamcop.net> wrote:
> > >
> > > Well, the class referenced by _groups must
have a method called
> > > Load. What's in it? Have you tried
commenting out different lines in
> > the
> > > Load method to see what no longer "keeps
the ability to display values
> > > working"?
> > >
> > > At 04:33 PM 6/20/2007, Mike Andrews wrote (in
part)
> > >
> > > > private void Load(Guid guid, MarType
type, DateTime startDate,
> > > >TransactionContext transaction){
> > > > //Nothing is readable in here except
intrinsic data types
> > > > ...
> > > > //This is the line, that when
commented out, keeps the ability to
> > > >display values working
> > > > _groups.Load(details, type,
startDate);
> > > > }
> > > >
> > > >}
> > > >
> > > >_groups is a variable that references a
custom class (that inherits
> > > directly
> > > >from System.Object) that has no
"special" functionality in it
> > whatsoever.
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > J. Merrill / Analytical Software Corp
> > >
> > > ===================================
> > > This list is hosted by DevelopMentor(r) http://www.develop.com
> > >
> > > View archives and manage your subscription(s)
at
> > > http://discuss.develop.com
> > >
> >
> > ===================================
> > This list is hosted by DevelopMentor(r) http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
> > ===================================
> > This list is hosted by DevelopMentor(r) http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
>
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where garbage collection |
  United Kingdom |
2007-06-21 17:22:09 |
> Does anyone know the maximum size of a struct that can
be used in the
> Framework without having these issues?
The general rule of thumb is : If you're worrying about the
maximum size
of a struct, it's already too big!
Structs were designed to be used for small lightweight data
types (like
Point, Rectangle, etc)
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where g |
  United Kingdom |
2007-06-21 17:22:09 |
> Does anyone know the maximum size of a struct that can
be used in the
> Framework without having these issues?
The general rule of thumb is : If you're worrying about the
maximum size
of a struct, it's already too big!
Structs were designed to be used for small lightweight data
types (like
Point, Rectangle, etc)
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where garbage collection |

|
2007-06-21 17:56:29 |
Very true.
I was just curious.
I'm generally more sparing on my use of structs.
Nevertheless, I still want to know the maximum size of a
struct or if there
is no size limit, the optimal size of a struct.
On 6/21/07, Chris Anderson <Chris activeide.com> wrote:
>
> > Does anyone know the maximum size of a struct that
can be used in the
> > Framework without having these issues?
>
> The general rule of thumb is : If you're worrying about
the maximum size
> of a struct, it's already too big!
>
> Structs were designed to be used for small lightweight
data types (like
> Point, Rectangle, etc)
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where g |

|
2007-06-21 17:56:29 |
Very true.
I was just curious.
I'm generally more sparing on my use of structs.
Nevertheless, I still want to know the maximum size of a
struct or if there
is no size limit, the optimal size of a struct.
On 6/21/07, Chris Anderson <Chris activeide.com> wrote:
>
> > Does anyone know the maximum size of a struct that
can be used in the
> > Framework without having these issues?
>
> The general rule of thumb is : If you're worrying about
the maximum size
> of a struct, it's already too big!
>
> Structs were designed to be used for small lightweight
data types (like
> Point, Rectangle, etc)
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where g |
  United Kingdom |
2007-06-21 18:41:08 |
I've been trying to look for a cite, but can only tell you
that I was
told by a instructor (albeit a SQL Server 2005 one) anything
bigger than
about 150 bytes was too big (remembering that a reference to
a
DataTable, etc was only the size of the *reference* and not
the size of
the data table contents, etc), but really it depends on
usage IMO.
One cite I *can* find is that "Unless you need
reference type semantics,
a class that is smaller than 16 bytes may be more
efficiently handled by
the system as a struct"
htt
p://msdn2.microsoft.com/en-us/library/ah19swz4(vs.71).as
px
Not that that helps of course
> -----Original Message-----
> From: Discussion of advanced .NET topics.
[mailto:ADVANCED-
> DOTNET DISCUSS.DEVELOP.COM] On Behalf Of Mike Andrews
> Sent: 22 June 2007 00:01
> To: ADVANCED-DOTNET DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] PRB: Cannot evaluate
expression because
> a thread is stopped at a point where garbage collection
is
> impossible...
>
> Very true.
> I was just curious.
> I'm generally more sparing on my use of structs.
>
> Nevertheless, I still want to know the maximum size of
a struct or if
> there
> is no size limit, the optimal size of a struct.
>
>
> On 6/21/07, Chris Anderson <Chris activeide.com> wrote:
> >
> > > Does anyone know the maximum size of a struct
that can be used in
> the
> > > Framework without having these issues?
> >
> > The general rule of thumb is : If you're worrying
about the maximum
> size
> > of a struct, it's already too big!
> >
> > Structs were designed to be used for small
lightweight data types
> (like
> > Point, Rectangle, etc)
> >
> > ===================================
> > This list is hosted by DevelopMentor(r) http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where garbage collection |
  United Kingdom |
2007-06-21 18:41:08 |
I've been trying to look for a cite, but can only tell you
that I was
told by a instructor (albeit a SQL Server 2005 one) anything
bigger than
about 150 bytes was too big (remembering that a reference to
a
DataTable, etc was only the size of the *reference* and not
the size of
the data table contents, etc), but really it depends on
usage IMO.
One cite I *can* find is that "Unless you need
reference type semantics,
a class that is smaller than 16 bytes may be more
efficiently handled by
the system as a struct"
htt
p://msdn2.microsoft.com/en-us/library/ah19swz4(vs.71).as
px
Not that that helps of course
> -----Original Message-----
> From: Discussion of advanced .NET topics.
[mailto:ADVANCED-
> DOTNET DISCUSS.DEVELOP.COM] On Behalf Of Mike Andrews
> Sent: 22 June 2007 00:01
> To: ADVANCED-DOTNET DISCUSS.DEVELOP.COM
> Subject: Re: [ADVANCED-DOTNET] PRB: Cannot evaluate
expression because
> a thread is stopped at a point where garbage collection
is
> impossible...
>
> Very true.
> I was just curious.
> I'm generally more sparing on my use of structs.
>
> Nevertheless, I still want to know the maximum size of
a struct or if
> there
> is no size limit, the optimal size of a struct.
>
>
> On 6/21/07, Chris Anderson <Chris activeide.com> wrote:
> >
> > > Does anyone know the maximum size of a struct
that can be used in
> the
> > > Framework without having these issues?
> >
> > The general rule of thumb is : If you're worrying
about the maximum
> size
> > of a struct, it's already too big!
> >
> > Structs were designed to be used for small
lightweight data types
> (like
> > Point, Rectangle, etc)
> >
> > ===================================
> > This list is hosted by DevelopMentor(r) http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
| Re: PRB: Cannot evaluate expression
because a thread is stopped at a point
where g |

|
2007-06-25 08:14:44 |
Thank you Chris.
I think the sum total sizes of the "references"
for all the objects in the
struct and the additional parameters on the method was
greater than 256
bytes.
I got word back from MS on this issue:
"...generally speaking, when the total size of the
arguments passed to a
callee function is larger than 256 bytes, JIT will make the
caller function
partially interruptible. In a partially interruptible code,
not every
location in the code is a GC safe point. Therefore, it
might be unsafe to
evaluate expression at certain locations. When this happens
you get [the
error message]."
So it seems that even since the fields were references, the
sum of all them
exceeded the 256 byte *limit* for the debugger.
On 6/21/07, Chris Anderson <Chris activeide.com> wrote:
>
> I've been trying to look for a cite, but can only tell
you that I was
> told by a instructor (albeit a SQL Server 2005 one)
anything bigger than
> about 150 bytes was too big (remembering that a
reference to a
> DataTable, etc was only the size of the *reference* and
not the size of
> the data table contents, etc), but really it depends on
usage IMO.
>
> One cite I *can* find is that "Unless you need
reference type semantics,
> a class that is smaller than 16 bytes may be more
efficiently handled by
> the system as a struct"
>
> htt
p://msdn2.microsoft.com/en-us/library/ah19swz4(vs.71).as
px
>
> Not that that helps of course
>
>
>
> > -----Original Message-----
> > From: Discussion of advanced .NET topics.
[mailto:ADVANCED-
> > DOTNET DISCUSS.DEVELOP.COM] On Behalf Of Mike
Andrews
> > Sent: 22 June 2007 00:01
> > To: ADVANCED-DOTNET DISCUSS.DEVELOP.COM
> > Subject: Re: [ADVANCED-DOTNET] PRB: Cannot
evaluate expression because
> > a thread is stopped at a point where garbage
collection is
> > impossible...
> >
> > Very true.
> > I was just curious.
> > I'm generally more sparing on my use of structs.
> >
> > Nevertheless, I still want to know the maximum
size of a struct or if
> > there
> > is no size limit, the optimal size of a struct.
> >
> >
> > On 6/21/07, Chris Anderson <Chris activeide.com> wrote:
> > >
> > > > Does anyone know the maximum size of a
struct that can be used in
> > the
> > > > Framework without having these issues?
> > >
> > > The general rule of thumb is : If you're
worrying about the maximum
> > size
> > > of a struct, it's already too big!
> > >
> > > Structs were designed to be used for small
lightweight data types
> > (like
> > > Point, Rectangle, etc)
> > >
> > > ===================================
> > > This list is hosted by DevelopMentor(r) http://www.develop.com
> > >
> > > View archives and manage your subscription(s)
at
> > > http://discuss.develop.com
> > >
> >
> > ===================================
> > This list is hosted by DevelopMentor(r) http://www.develop.com
> >
> > View archives and manage your subscription(s) at
> > http://discuss.develop.com
> >
>
> ===================================
> This list is hosted by DevelopMentor(r) http://www.develop.com
>
> View archives and manage your subscription(s) at
> http://discuss.develop.com
>
===================================
This list is hosted by DevelopMentorŪ http://www.develop.com
View archives and manage your subscription(s) at http://discuss.develop.com
|
|
[1-18]
|
|