Thread overview | |||||
---|---|---|---|---|---|
|
November 15, 2006 GC don't understand | ||||
---|---|---|---|---|
| ||||
Hi. I'm developing a web server application using threads and sockets. It's quite simple but it throws "Error: Access Violation" and stops responding for incoming connections very frequently. When it occurs I have to Ctrl-C the server and restart to continue its work. I've put tons of debug info to trace the error but I've found no order on where it throws. So for a try I disabled the GC and now it works as it should. Why does this happen? How could I re-enable the GC (memory consuming is increasing by every connection) without having to fear of Access Violation errors? Regards, Nahon |
November 16, 2006 Re: GC don't understand | ||||
---|---|---|---|---|
| ||||
Posted in reply to Nahon | Nahon wrote: > Hi. > > I'm developing a web server application using threads and sockets. It's quite > simple but it throws "Error: Access Violation" and stops responding for > incoming connections very frequently. When it occurs I have to Ctrl-C the > server and restart to continue its work. I've put tons of debug info to trace > the error but I've found no order on where it throws. So for a try I disabled > the GC and now it works as it should. > Why does this happen? How could I re-enable the GC (memory consuming is > increasing by every connection) without having to fear of Access Violation errors? > > Regards, > Nahon Access Violations can be caused by a few things. One of these is attempting to use a null object, but it doesn't sound like that. The other is attempting to use an object that's been deleted. D's GC should never delete an object you still have a reference to; are you deleting objects manually? If so, that could be your problem: you're deleting an object and then trying to use it again. It's really the only thing I can think of at the moment; sorry. -- Daniel -- Unlike Knuth, I have neither proven or tried the above; it may not even make sense. v2sw5+8Yhw5ln4+5pr6OFPma8u6+7Lw4Tm6+7l6+7D i28a2Xs3MSr2e4/6+7t4TNSMb6HTOp5en5g6RAHCP http://hackerkey.com/ |
November 16, 2006 Re: GC don't understand | ||||
---|---|---|---|---|
| ||||
Posted in reply to Daniel Keep | Daniel Keep wrote:
>
> Nahon wrote:
>> Hi.
>>
>> I'm developing a web server application using threads and sockets. It's quite
>> simple but it throws "Error: Access Violation" and stops responding for
>
> Access Violations can be caused by a few things. One of these is
> attempting to use a null object, but it doesn't sound like that. The
> other is attempting to use an object that's been deleted.
>
Could also be because you're passing D char[]'s to C functions that expect char*. Any time you call a C function that takes a string, you need to call toStringz() on it.
--bb
|
Copyright © 1999-2021 by the D Language Foundation