You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by "Raymond Feng (JIRA)" <ji...@apache.org> on 2007/09/04 20:02:45 UTC

[jira] Created: (WSCOMMONS-240) Add a close method to OMNode

Add a close method to OMNode
----------------------------

                 Key: WSCOMMONS-240
                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-240
             Project: WS-Commons
          Issue Type: Improvement
          Components: AXIOM
            Reporter: Raymond Feng


We're experiencing some memory leaks in AXIOM with some implementations of XML StAX parsers. The main reason is that when an OM tree is backed by a builder or parser, we don't have an API at OM level to release the underlying resources.

As a user of OM, there are threee cases:

1. Immediately close the builder/parser if one exists 
2. Build the subtree and then close the parser
3. Build the entire document and then close the parser

OMNode already has a method to build itself and its subtree (OMNode.build()).

Given this information and OM terminology, perhaps the following makes sense.

/**
  * Close and remove the builder and parser of the OMNode if they exist.
  * @param build.  If true the subtree is built prior to closing the builder and parser.
  */
public void close(boolean build);

This would satisfy (1) and (2).

Then if someone needed (3) they can always traverse up to the OMDocument and call close(true).

Does it make sense? Please advise me a better approach otherwise.

Thanks,
Raymond


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Assigned: (WSCOMMONS-240) Add a close method to OMNode

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle reassigned WSCOMMONS-240:
----------------------------------------

    Assignee: Rich Scheuerle

> Add a close method to OMNode
> ----------------------------
>
>                 Key: WSCOMMONS-240
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-240
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Raymond Feng
>            Assignee: Rich Scheuerle
>
> We're experiencing some memory leaks in AXIOM with some implementations of XML StAX parsers. The main reason is that when an OM tree is backed by a builder or parser, we don't have an API at OM level to release the underlying resources.
> As a user of OM, there are threee cases:
> 1. Immediately close the builder/parser if one exists 
> 2. Build the subtree and then close the parser
> 3. Build the entire document and then close the parser
> OMNode already has a method to build itself and its subtree (OMNode.build()).
> Given this information and OM terminology, perhaps the following makes sense.
> /**
>   * Close and remove the builder and parser of the OMNode if they exist.
>   * @param build.  If true the subtree is built prior to closing the builder and parser.
>   */
> public void close(boolean build);
> This would satisfy (1) and (2).
> Then if someone needed (3) they can always traverse up to the OMDocument and call close(true).
> Does it make sense? Please advise me a better approach otherwise.
> Thanks,
> Raymond

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Commented: (WSCOMMONS-240) Add a close method to OMNode

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/WSCOMMONS-240?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12524847 ] 

Rich Scheuerle commented on WSCOMMONS-240:
------------------------------------------

Good ideas.

Some users of Axiom (such as Raymond) only view the OM data via the "Data Model" interfaces.
They don't need to query the underlying builder/parser code, but they do want to indicate that they are "done".

Having a close(boolean) convenience method on OMNode will make it easier for these users to interact with Axiom without
exposing them to other layers of complexity.

I will volunteer to make the changes.

Thanks,
Rich

> Add a close method to OMNode
> ----------------------------
>
>                 Key: WSCOMMONS-240
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-240
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Raymond Feng
>            Assignee: Rich Scheuerle
>
> We're experiencing some memory leaks in AXIOM with some implementations of XML StAX parsers. The main reason is that when an OM tree is backed by a builder or parser, we don't have an API at OM level to release the underlying resources.
> As a user of OM, there are threee cases:
> 1. Immediately close the builder/parser if one exists 
> 2. Build the subtree and then close the parser
> 3. Build the entire document and then close the parser
> OMNode already has a method to build itself and its subtree (OMNode.build()).
> Given this information and OM terminology, perhaps the following makes sense.
> /**
>   * Close and remove the builder and parser of the OMNode if they exist.
>   * @param build.  If true the subtree is built prior to closing the builder and parser.
>   */
> public void close(boolean build);
> This would satisfy (1) and (2).
> Then if someone needed (3) they can always traverse up to the OMDocument and call close(true).
> Does it make sense? Please advise me a better approach otherwise.
> Thanks,
> Raymond

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org


[jira] Resolved: (WSCOMMONS-240) Add a close method to OMNode

Posted by "Rich Scheuerle (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/WSCOMMONS-240?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rich Scheuerle resolved WSCOMMONS-240.
--------------------------------------

    Resolution: Fixed

Committed code and test.  Revision = 573038

> Add a close method to OMNode
> ----------------------------
>
>                 Key: WSCOMMONS-240
>                 URL: https://issues.apache.org/jira/browse/WSCOMMONS-240
>             Project: WS-Commons
>          Issue Type: Improvement
>          Components: AXIOM
>            Reporter: Raymond Feng
>            Assignee: Rich Scheuerle
>
> We're experiencing some memory leaks in AXIOM with some implementations of XML StAX parsers. The main reason is that when an OM tree is backed by a builder or parser, we don't have an API at OM level to release the underlying resources.
> As a user of OM, there are threee cases:
> 1. Immediately close the builder/parser if one exists 
> 2. Build the subtree and then close the parser
> 3. Build the entire document and then close the parser
> OMNode already has a method to build itself and its subtree (OMNode.build()).
> Given this information and OM terminology, perhaps the following makes sense.
> /**
>   * Close and remove the builder and parser of the OMNode if they exist.
>   * @param build.  If true the subtree is built prior to closing the builder and parser.
>   */
> public void close(boolean build);
> This would satisfy (1) and (2).
> Then if someone needed (3) they can always traverse up to the OMDocument and call close(true).
> Does it make sense? Please advise me a better approach otherwise.
> Thanks,
> Raymond

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@ws.apache.org
For additional commands, e-mail: commons-dev-help@ws.apache.org