Re: getting Segmentation Violation
- From: "000.tushar@xxxxxxxxx" <000.tushar@xxxxxxxxx>
- Date: Thu, 10 Jan 2008 00:04:01 -0800 (PST)
thanks for replying. I need to specify few more details to make the
problem clearer. I am using Allegro CL 7 on windows machine with 512
mb RAM.
On Jan 8, 2:02 am, vanekl <va...@xxxxxxx> wrote:
On Jan 7, 3:18 pm, "000.tus...@xxxxxxxxx" <000.tus...@xxxxxxxxx>yes, it works fine for smaller test samples.
wrote:
hello all,
I am developing a lisp application which analyzes the source code.
During analysis it creates many objects using make-instance. The
problem is ....the program consumes available memory and PF usage
reaches to 1.90 GB and program emits an exception 'Segmentation
violation: error no 11'
To optimize it, I am now using secondary storage to dump the
intermediate objects and retrieving them back whenever required. But
still...I am not getting rid of the problem(even though many make-
instance are removed).
So ... can anyone help me. or atleast some pointers towards memory
model of lisp. thanks in advance.
1. Make sure your code works with smaller test samples.
2. Are you making heavy use of recursion? Some recursive forms may not
be optimized and make heavy use of the stack, breaking it. To make
sure you aren't accidentally getting into a run-away recursive
situation you can keep track of the depth and throw an error if it
gets too large.
i m using recursion at few places, but not heavy.
Also keep in mind that this situation can also occur with a set ofno, i m not calling any C lib.
functions that call one another and get trapped in a never-ending
cycle, also possibly busting the stack.
3. Instrumenting/profiling your code will probably give insight. If
there's one thing I've learned, the pilot makes more errors than the
plane, and it's more productive to investigate there first.
When I say "instrument" I mean something as simple as keeping a
running log file or just stream to standard output with messages about
where the program is as it is running.
4. Some OSs allow the sysadmin to specify hard upper limits on the
amount of files one is allowed to open and the amount of memory that
may be consumed. Since you specify neither OS nor system limits,
you're on your own there.
5. If you compiled the Lisp yourself, you may want to think back
whether it passed all tests, or whether the tests were even run.
6. Is it possible you are calling an external C library when the error
occurs?
7. If you think you've run out of main memory, is it possible to map/
reduce the problem in a lazy manner if you aren't already, or merge
results from smaller problem sets?
8. Reboot.
9. Is the problem repeatable on other hardware?
yes, it is.
10. Go to the bathroom and think about it some more. I do my best work
in the bathroom; it might help you, too.
Apart from these, I also tried these:-
1. I am calling GC explicitly.
2. I was passing heavy hash tables previously from one function to
other, i identified them and made them global.
Still...there is almost zero performance gain. :(
-Tushar
.
- Follow-Ups:
- Re: getting Segmentation Violation
- From: Thomas A. Russ
- Re: getting Segmentation Violation
- From: vanekl
- Re: getting Segmentation Violation
- References:
- getting Segmentation Violation
- From: 000.tushar@xxxxxxxxx
- Re: getting Segmentation Violation
- From: vanekl
- getting Segmentation Violation
- Prev by Date: Re: Erlang concurrency
- Next by Date: [SAS 2008] Last CFP
- Previous by thread: Re: getting Segmentation Violation
- Next by thread: Re: getting Segmentation Violation
- Index(es):
Relevant Pages
|