incubator-clerezza-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hasan Hasan <ha...@trialox.org>
Subject Re: [jira] Created: (CLEREZZA-418) Strange behaviour of GraphNode
Date Tue, 08 Feb 2011 12:59:27 GMT
what this.getBundleGraph() does actually?
how is the GraphNode created that you pass to addToLuceneIndex? (in
particular how you get the graph that is used to create the GraphNode

the type of MGraph used to create the GraphNode might explain the "strange"
behavior

regards
hasan


On Tue, Feb 8, 2011 at 1:29 PM, franco fallica (JIRA) <jira@apache.org>wrote:

> Strange behaviour of GraphNode
> ------------------------------
>
>                 Key: CLEREZZA-418
>                 URL: https://issues.apache.org/jira/browse/CLEREZZA-418
>             Project: Clerezza
>          Issue Type: Question
>         Environment: win7
>            Reporter: franco fallica
>            Priority: Minor
>
>
> Hi all,
>
> I just ran into an interesting issue, and I want to let you know.
>
> I've got a method like that. ( We use that GraphNode a lot before we pass
> it to that method)
>
> protected void addToLuceneIndex(GraphNode clip){
> (0)
> // then some stuff like that
>          Document doc = new Document();
>            Iterator<Literal> iter;
>            doc.add(new Field(LuceneDocumentClips.url,
> URLParser.formIndexableURL(((UriRef) clip.getNode()).getUnicodeString()),
> Field.Store.YES, Field.Index.NOT_ANALYZED));
> (1) System.out.println("before getLiterals");
>            iter = clip.getLiterals(DCTERMS.title);
> (2) System.out.println("after getLiterals");
>            while (iter.hasNext()) {
>                doc.add(new Field(LuceneDocumentClips.title,
> iter.next().getLexicalForm().trim(), Field.Store.NO,
> Field.Index.ANALYZED));
>            }
> // and some more
> }
>
> with this method. Line (2) "after getLiterals" is never reached and jvm
> throws a OutOfMemoryException (Heap space)  right on getLiterals()
>
> I changed the method on line (0) to:
>
> protected void addToLuceneIndex(GraphNode clipNode) {
> (0)          GraphNode clip = new GraphNode(clipNode.getNode(),
> this.getBundleGraph());
>
> // the same stuff as before
> ...
> ...
>
> }
>
> and strangely it works!
>
> Why in gods name can instatiating a new GraphNode (of a allready
> instatiated node) fix a OutOfMemoryException?
>
> even stranger  - CommittableGraphNode fixes the issue as well :
>
> protected void addToLuceneIndex(GraphNode clipNode) {
> (0)          CommittableGraphNode clip = new CommittableGraphNode
> (clipNode.getNode(),new CommittableMGraph(new LockableMGraph(
> this.getBundleGraph())));
>
> // the same stuff as before
> ...
> ...
>
> }
>
>
> and just to make things more interessting. the following fixes it too.
>
> protected void addToLuceneIndex(GraphNode clipNode) {
> (0)          GraphNode clip = new GraphNode (clipNode.getNode(),new
> CommittableMGraph(new LockableMGraph( this.getBundleGraph())));
>
> // the same stuff as before
> ...
> ...
>
> }
>
> --
> This message is automatically generated by JIRA.
> -
> For more information on JIRA, see: http://www.atlassian.com/software/jira
>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message