[dba-VB] Thread.sleep

David McAfee davidmcafee at gmail.com
Wed Apr 4 14:17:38 CDT 2012


Garbage Collection, although I think you are being facetious. :)


You have stirred up in my head regarding a project that I have out there
that seems to cause memory issues on certain computers.

I haven't been able to recreate this in my office.

I do use sleep as well in several places in that app.

Care to share the code that worked for you?

Thanks,
David


On Wed, Apr 4, 2012 at 12:10 PM, jwcolby <jwcolby at colbyconsulting.com>wrote:

> LOL.  GC?  What is GC?
>
>
> John W. Colby
> Colby Consulting
>
> Reality is what refuses to go away
> when you do not believe in it
>
> On 4/4/2012 12:41 PM, Salakhetdinov Shamil wrote:
>
>> GC ?
>>
>>
>> Wed, 04 Apr 2012 10:02:28 -0400 от jwcolby<jwcolby@**colbyconsulting.com<jwcolby at colbyconsulting.com>
>> >:
>>
>>> I am baffled by what I am seeing in my threaded program.  I start a
>>> thread which basically pulls
>>> data from SQL Server.  It does so then does a thread.sleep(10000) which
>>> should sleep for 10000 ms
>>> (10 seconds).  During the sleep, the processor usage jumps to roughly
>>> 25%.
>>>
>>> That indicates that the sleep enables something else to go bonkers but
>>> what is that "something else"
>>> and why does it depend on this thread sleeping?  I really don't want my
>>> app consuming 25% of the
>>> processor sleeping.
>>>
>>> On Google I see this question posted on many venues but no real answer.
>>>
>>> In fact I decided that what I was really trying to accomplish was
>>> provided by a timer class so I am
>>> in the process of rewriting my code to use the timer.  I did it in one
>>> place and it works well, no
>>> more do while / thread.sleep for me.
>>>
>>> I'd still like to know what caused the system to spike CPU usage when
>>> the thread was sleeping though.
>>>
>>> --
>>> John W. Colby
>>> Colby Consulting
>>>
>>> Reality is what refuses to go away
>>> when you do not believe in it
>>>
>>> ______________________________**_________________
>>> dba-VB mailing list
>>> dba-VB at databaseadvisors.com
>>> http://databaseadvisors.com/**mailman/listinfo/dba-vb<http://databaseadvisors.com/mailman/listinfo/dba-vb>
>>> http://www.databaseadvisors.**com <http://www.databaseadvisors.com>
>>>
>>>
>>>
>> ______________________________**_________________
>> dba-VB mailing list
>> dba-VB at databaseadvisors.com
>> http://databaseadvisors.com/**mailman/listinfo/dba-vb<http://databaseadvisors.com/mailman/listinfo/dba-vb>
>> http://www.databaseadvisors.**com <http://www.databaseadvisors.com>
>>
>>
> ______________________________**_________________
> dba-VB mailing list
> dba-VB at databaseadvisors.com
> http://databaseadvisors.com/**mailman/listinfo/dba-vb<http://databaseadvisors.com/mailman/listinfo/dba-vb>
> http://www.databaseadvisors.**com <http://www.databaseadvisors.com>
>
>


More information about the dba-VB mailing list