Re: getting Segmentation Violation
- From: tar@xxxxxxxxxxxxx (Thomas A. Russ)
- Date: 10 Jan 2008 10:46:40 -0800
"000.tushar@xxxxxxxxx" <000.tushar@xxxxxxxxx> writes:
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>
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).
Apart from these, I also tried these:-
1. I am calling GC explicitly.
This normally shouldn't matter, unless you have an implementation with a
generational collector and there is some feature of your GC that allows
explicit calls to examine and reclaim storage from what would otherwise
be deemed to be permanent generations.
2. I was passing heavy hash tables previously from one function to
other, i identified them and made them global.
That shouldn't matter at all. Values passed as arguments in Lisp are
not copied, so only a pointer to the hash table would be passed. So you
wouldn't expect there to be any change:
Still...there is almost zero performance gain. :(
If you are running out of heap space, then you must have some objects
being kept around. Lisp can't GC any object to which there is a live
pointer. You mention hash tables, especially big ones. So any objects
that are referenced (stored) in those hash tables will continue to
consume memory. It can't go away, because the hash table in question
provides a means of accessing it. If you make those hash table global,
the problem is likely to only get worse, since then they never go away.
If I had to guess, I would suppose that you are keeping references to
those intermediate objects somewhere in your code. That prevents them
from becoming garbage, and thus the storage never gets freed.
As for how to track this down, it is somewhat tricky. Check the GC and
memory space information documentation that comes with your Lisp
implementation. Perhaps there is a way of seeing how much memory is
allocated and to which objects. That could give you some clues as to
where you are hanging onto objects that you no longer need.
Using global variables is one way to keep references to objects. Make
sure that you use lexical variables so that they release references to
objects and tables when they are no longer needed.
You mention that you now use secondary storage. After you save the
objects to the secondary storage, are you sure that you are getting rid
of the references to those objects? If you continue to maintain
references, then secondary storage alone won't help you.
--
Thomas A. Russ, USC/Information Sciences Institute
.
- References:
- getting Segmentation Violation
- From: 000.tushar@xxxxxxxxx
- Re: getting Segmentation Violation
- From: vanekl
- Re: getting Segmentation Violation
- From: 000.tushar@xxxxxxxxx
- getting Segmentation Violation
- Prev by Date: Re: getting Segmentation Violation
- Next by Date: Re: Hutchentoot or Allegroserve?
- Previous by thread: Re: getting Segmentation Violation
- Next by thread: editor for direct editing of the syntax tree: possible?
- Index(es):
Relevant Pages
|