Memory leak in UIButton setFont method

Hi,
Hope you all doing well, I am getting a memory leak while setting the font of UIButton. This is the code which I am using to set the font,
[MyBtn.titleLabel setFont:[UIFont boldSystemFontOfSize:12]];
whereas MyBtn is connected to IBOoutlet and I am not allocating memory to it.
I don't see any thing wrong in the code. Hopefully someone will help me out, I will be really thankful.

In instrument the responsible library is UIKit and UILabel is the leaked object so I am also not sure whether instrument is pointing the right line or not.
Below is the function in which I am getting the leak,
- (void) LayoutUI
[bgImageView setImage:[UIImage imageNamed:@"bgImage.png"]];
[topImageHeaderView setImage:[UIImage imageNamed:@"headerImage.png"]];
[logoImageView setImage:[UIImage imageNamed:@"logo.png"]];
[HeaderImageView setImage:[UIImage imageNamed:@"headerImageView.png"]];
[BackBtn setTitle:@"Back" forState:UIControlStateNormal];
[BackBtn.titleLabel setFont:[UIFont boldSystemFontOfSize:12]];
[BackBtn setBackgroundImage:[UIImage imageNamed:@"back.png"] forState:UIControlStateNormal];
//below is the Leaked line of code
[BackBtn.titleLabel setTextColor:[UIColor colorWithRed:(50.0/256.0) green:(100.0/256.0) blue:(200.0/256.0) alpha:1]];
[headerLbl setText:@"Header"];
//below two lines are leaked
[headerLbl setFont:[UIFont boldSystemFontOfSize:12]];
[headerLbl setTextColor:[UIColor colorWithRed:(50.0/256.0) green:(100.0/256.0) blue:(200.0/256.0) alpha:1]];
hopefully this will show a picture of what I am doing in my code.
One more thing all these UIlabels and UIImage are connected to IBOoutlet so I am not allocating memory to any of them but though I have tried to dealloc all of them in dealloc method but it didn't help me out.

Similar Messages

  • Memory leak in Jeditorpane.setText method while displaying html content

    I tried to display a larger size html page using JeditorPane. But I found that there as a huge memory leak after JEditorPane's setText method was called.
    Refering to the below code there was a difference of about 40 MB after the setText method was called.This does not happen if we display the page in rtf format.This finally results in Out Of memry error.
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    import java.awt.BorderLayout;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileReader;
    import java.io.IOException;
    import javax.swing.JEditorPane;
    import javax.swing.JFrame;
    public class SampleProgram extends JFrame{
    public JEditorPane pane;
    static public String getContents(File aFile) {
    StringBuffer contents = new StringBuffer();
    try {
    BufferedReader input = new BufferedReader(new FileReader(aFile));
    try {
    String line = null;
    while (( line = input.readLine()) != null){
    contents.append(line);
    contents.append(System.getProperty("line.separator"));
    finally {
    input.close();
    catch (IOException ex){
    ex.printStackTrace();
    return contents.toString();
    public SampleProgram() {
    pane = new JEditorPane();
    pane.setContentType("text/html");
    pane.setEditable(false);
    pane.setCaretPosition(0);
    pane.setAutoscrolls(true);
    getContentPane().add(pane, BorderLayout.CENTER);
    setSize(400,400);
    File file = new File("D:/Audit_Log.html");
    String summary = getContents(file);
    System.out.println("Memory used Before setText invoke ==>" +((Runtime.getRuntime().totalMemory()- Runtime.getRuntime().freeMemory())/1000000)+"M");
    pane.setText(summary);
    System.out.println("Memory used after setText invoke ==>" +((Runtime.getRuntime().totalMemory()- Runtime.getRuntime().freeMemory())/1000000)+"M");
    setVisible(true);
    * @param args
    public static void main(String[] args) {
    new SampleProgram () ;
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The html i am trying to display is similar to the one below.But the original content almost 10 times bigger than this html content and it has only td and tr tags. and for this file the leak is about 4 MB and if I use the file 10 times bigger than this it is 40M .
    Any suggestions how to avoid this memory leak?
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    <html>
    <body>
    <h1 align="center">Test HTML</h1>
    <table align="center" border="0" width="90%">
    <tr>
    <td>
    <h3>10-Sep-2008 08:11:32 GMT - <i>User</i>
    </h3>
    <h4>Employee 1 - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 2 - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 3, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 4, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 5, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 6, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 7, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 8, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 9, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 10, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 11, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 12, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 13, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 14, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 15, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 16, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 17, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 18, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 19, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 20, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 21, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 22, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 23, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 24, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 25, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 26, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 27, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 28, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 29, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 30, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 31, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 32, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 33, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 34, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 35, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 36, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>Green</td>
    </tr>
    <tr>
    <td>vision</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 37, - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Name</td><td></td><td>xyzxyz</td>
    </tr>
    <tr>
    <td>Place</td><td></td><td>Mangalore</td>
    </tr>
    <tr>
    <td>State</td><td></td><td>Karnataka</td>
    </tr>
    <tr>
    <td>Country</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    <tr></tr>
    <tr>
    <td>Unit </td><td></td><td>India/MT</td>
    </tr>
    <tr>
    <td>Floor</td><td></td><td>MARblE</td>
    </tr>
    <tr>
    <td>Rating</td><td></td><td>Quantity: amount = 45 uom = MT</td>
    </tr>
    </table>
    <br>
    <h4>Employee 60, Employed - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Price</td><td></td><td>India/MT</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Employee - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Accept the agreement</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Indicator</td><td></td><td>True</td>
    </tr>
    <tr>
    <td>Conditions</td><td></td><td>AIR</td>
    </tr>
    <tr>
    <td> Status</td><td></td><td>QUALIFIED</td>
    </tr>
    <tr>
    <td>Job Type</td><td></td><td>ddddd</td>
    </tr>
    <tr>
    <td>agreement signed</td><td></td><td>TRUE</td>
    </tr>
    <tr>
    <td>Degree</td><td></td><td>True</td>
    </tr>
    <tr>
    <td> Options</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Quality</td><td></td><td>TRUE</td>
    </tr>
    <tr>
    <td>Quantity</td><td></td><td>123</td>
    </tr>
    <tr>
    <td>Basis</td><td></td><td>TOTAL</td>
    </tr>
    <tr>
    <td>GapPresent</td><td></td><td>TRUE</td>
    </tr>
    <tr>
    <td>Unit </td><td></td><td>MT</td>
    </tr>
    <tr>
    <td>Warning</td><td></td><td>4000000</td>
    </tr>
    <tr>
    <td>Rounding </td><td></td><td>3</td>
    </tr>
    <tr>
    <td>Security</td><td></td><td>OC</td>
    </tr>
    <tr>
    <td>Number</td><td></td><td>61</td>
    </tr>
    <tr>
    <td>Employee Status</td><td></td><td>Rupee INDIA</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61 - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Alternative </td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Advantage</td><td></td><td>all</td>
    </tr>
    <tr>
    <td>Loading</td><td></td><td>all</td>
    </tr>
    <tr>
    <td>flag</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Lateral</td><td></td><td>True</td>
    </tr>
    <tr>
    <td> Mode</td><td></td><td>Null</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Chain - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Roll Number</td><td></td><td>1</td>
    </tr>
    <tr>
    <td>Section</td><td></td><td>AA</td>
    </tr>
    <tr>
    <td>Percentage</td><td></td><td>100</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Employee Terms - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Date of Record</td><td></td><td>DateRange
    startDate=01-Jun-2009
    endDate=30-Jun-2009
    </td>
    </tr>
    <tr>
    <td>Continent</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Employed - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Price</td><td></td><td>India/MT</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Employed Term 1, Fixed Employed - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Alternative</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Price </td><td></td><td>123</td>
    </tr>
    <tr>
    <td>Unit </td><td></td><td>India/MT</td>
    </tr>
    <tr>
    <td>Floor</td><td></td><td>MARblE</td>
    </tr>
    <tr>
    <td>Remainder</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Rating</td><td></td><td>Return: amount = 55 uom = HH</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Employed Term 2, Fixed Employed - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Price </td><td></td><td>123</td>
    </tr>
    <tr>
    <td>Unit </td><td></td><td>India/MT</td>
    </tr>
    <tr>
    <td>Floor</td><td></td><td>MARblE</td>
    </tr>
    <tr>
    <td>Rating</td><td></td><td>Quantity: amount = 45 uom = MT</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Demurrage - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Country</td><td></td><td>Africa</td>
    </tr>
    <tr>
    <td>Term Period</td><td></td><td>2 months</td>
    </tr>
    <tr>
    <td>Time Period</td><td></td><td>Asia</td>
    </tr>
    <tr>
    <td>Flag ON/OFF</td><td></td><td>Asia</td>
    </tr>
    </table>
    <br>
    <h4>Employee 61, Organisation Job Settlement Term - <i>Create</i>
    </h4>
    <table border="0" width="100%">
    <th align="left" width="40%"><u>Field Name</u></th><th align="left" width="30%"><u>From Value</u></th><th align="left" width="30%"><u>To Value</u></th>
    <tr>
    <td>Indicator</td><td></td><td>aaaaa</td>
    </tr>
    <tr>
    <td>Alt Event</td><td></td><td>blSPLIT</td>
    </tr>
    <tr>
    <td>Alt Osssssssssssssst</td><td></td><td>2</td>
    </tr>
    <tr>
    <td>Calendar</td><td></td><td>NEW YORK</td>
    </tr>
    <tr>
    <td>Currency Type</td><td></td><td>India</td>
    </tr>
    <tr>
    <td>Day</td><td></td><td>aaaaa</td>
    </tr>
    <tr>
    <td>Event</td><td></td><td>bl</td>
    </tr>
    <tr>
    <td>alter ddddddddd</td><td></td><td>Asia</td>
    </t

    Screen_Name_09, You can post in the bug database.
    http://bugs.sun.com/bugdatabase/

  • Memory Leak in ArrayList ?

    Dear all,
    When I went thru the implementation of ArrayList, it just appeared to me that there can be a memory leak in the ensureCapacity method, which allocated new memory... The code is as below.
    *Increases the capacity of this <tt>ArrayList</tt> instance, if*
    necessary, to ensure that it can hold at least the number of elements
    *specified by the minimum capacity argument.*
    *@param   minCapacity   the desired minimum capacity*
        public void ensureCapacity(int minCapacity) {
         modCount++;
         int oldCapacity = elementData.length;
         if (minCapacity > oldCapacity) {
    *Object oldData[]* = elementData;
             int newCapacity = (oldCapacity * 3)/2 + 1;
                 if (newCapacity < minCapacity)
              newCapacity = minCapacity;
                // minCapacity is usually close to size, so this is a win:
                elementData = Arrays.copyOf(elementData, newCapacity);
        }Dont we need to make null the reference of oldData, as oldData = null, so that gc can reclaim the memory used by the old elementData, soon after the array copy (Arrays.copyOf) ??
    Please suggest if my understanding is wrong..
    Thanks & Regards
    Joby

    JOBY1985 wrote:
    Dear all,
    When I went thru the implementation of ArrayList, it just appeared to me that there can be a memory leak in the ensureCapacity method, which allocated new memory... The code is as below.
    *Increases the capacity of this <tt>ArrayList</tt> instance, if*
    necessary, to ensure that it can hold at least the number of elements
    *specified by the minimum capacity argument.*
    *@param   minCapacity   the desired minimum capacity*
    public void ensureCapacity(int minCapacity) {
         modCount++;
         int oldCapacity = elementData.length;
         if (minCapacity > oldCapacity) {
    *Object oldData[]* = elementData;
             int newCapacity = (oldCapacity * 3)/2 + 1;
             if (newCapacity < minCapacity)
              newCapacity = minCapacity;
    // minCapacity is usually close to size, so this is a win:
    elementData = Arrays.copyOf(elementData, newCapacity);
    }Dont we need to make null the reference of oldData, as oldData = null, so that gc can reclaim the memory used by the old elementData, soon after the array copy (Arrays.copyOf) ??No we don't need to set any thing to 'null'. The reference 'elementData' is update by the Arrays.copyOf() invocation and whatever it used to reference is then only referenced by oldData and when the block in which the reference 'oldData' is declared exits there will be no reference to the original array so it is eligible for GC.
    >
    Please suggest if my understanding is wrong..Your understanding is wrong.
    >
    Thanks & Regards
    JobyEdited by: sabre150 on Oct 20, 2009 1:20 PM

  • Querying BOE security - getObjectPrincipals() has memory leak?

    Hi,
    I am querying the BOBJ Enterprise security and noticed that when I introduce the getObjectPrincipals() method in my code, my program consumes a great deal of additional memory, and will eventually fail due to insufficient heap space as the code iterates through the reports.  The issue does seem to be tied to specifically this method, as the memory is handled fine with everything else the same.  Is there a known memory leak with this method?  I am currently testing against XI R2 SP2 and noticed in release notes for SP5 there was a documented memory leak with a similiar method in the COM SDK - getAnyPrincipals(). 
    Can anyone shed any light on this?  I can provide code samples too if need be...
    Thanks!

    Thanks for the responses guys. 
    Ruben - I did try to use remove() for both of my iterators in use (the first of which contains all principals who have rights for the given InfoObject, and the 2nd contains all of the explicit security rights for the principal) - this unfortunately didn't have any affect on the memory usage.  What I tried was as follows:
    ISecurityInfo objSecurityInfo = boInfoObject.getSecurityInfo();
    IObjectPrincipals objPrincipals = objSecurityInfo.getObjectPrincipals();  //THIS I BELIEVE TO HAVE MEMORY LEAK
    Iterator objPrincipalIterator = objPrincipals.iterator();
    //retrieve rights applied to object
    while (objPrincipalIterator.hasNext())
            ...get security Role information for each principal
            //now get explicit rights information
            ISecurityRights objPrincipalExpRights = objPrincipal.getRights();
            Iterator objPrincipalExpRightsIterator = objPrincipalExpRights.iterator();
            while (objPrincipalExpRightsIterator.hasNext()
                       ..process explicit rights
                       objPrincipalExpRightsIterator.remove();
    obPrincipalIterator.remove();
    Ted,
    I was already batching the # of InfoObjects to retrieve security information for, but just to be sure I greatly decreased this number and did not see any improvement in memory usage.  I actually worked a case with SAP on this question, and they confirmed there was a memory leak with the getObjectPrincipals() method.  They confirmed this was fixed for XI R2 in SP5 for the .Net and COM SDKs, but not for Java.  Is there anything else I can try?  Using getObjectPrincipals(1) for only explicit rights works great as far as memory consumption, but only exposes users with custom roles and I need to retrieve principals with any type of role.
    Thanks!

  • Memory leaks with Njawin and COm Object

    I'm using njawin 1.1 to use a DRM Microsoft object form java and all works
    very well .... very good bridge !!
    But I found a problem that seems like a "memory leak" in calling a method,
    in this lines code :
    myLicense = myLicenseObj.GetLicenseToDeliver();
    System.out.println(myLicense);
    myResponseObj.AddLicense("2.0.0.0", myLicense);
    myResponseObj.setReplaceQuotesWith("\\\"");
    myLicResponse = myResponseObj.GetLicenseResponse();
    The only particularity in this code the length of myLicense string : 7 KB
    If I run the program 1000 times the server use 100 Mb of ram and not release
    them.
    I try to use ASP to replicate the problem but nothing happens ... the
    program works and not memory leak appears and than I think taht the probelm
    may be in marshalling / unmarshalling string routine from/to the DRM object
    Thanks a lot for all help

    Me funciono colocando el progID de la interfaz que genero jawin en el constructor de la clase que se genero, despues utilice los metodos y fue transparente:
    Interfaz que genero jawin:::
    public interface CodeIMG {
    public static final GUID clsID = new GUID("{23435XCVDF2-6D62-6749- 8E00-00AS45GH87JU}");
    public static final String progID = new String("ActivexPDF.CodeIMG");
    la clase que genero jawin:::::::
    public class _CodeWER extends DispatchPtr {
    public int getTypeInfoToken() {
    return 0;
    static public final GUID proxyIID = new GUID("{632PHK77-6F0B-11D4-8PLD-00A024A31CC6}");
    static public final int iidToken;
    static {
    iidToken = IdentityManager.registerProxy(proxyIID, _CodeWER.class);
    public int getGuidToken() {
    return iidToken;
    * Creates empty _CodeWER Object
    public _CodeWER() throws COMException {
    super();
    * Creates _CodeWER() Object with progID
    public _CodeWER()(String progid) throws COMException {
    super(progid);
    * Queries interface of _CodeWER  Object
    public _CodeWER()(IUnknown other) throws COMException {
    super(other);
    * Creates _CodeWER() Object with CLSID
    public _CodeWER(GUID ClsID) throws COMException {
    super(ClsID);
    public boolean createImg(ObjectRef strChain, ObjectRef strFile) throws COMException {
    return ((java.lang.Boolean) invokeN("createImg", new Object[]{strChain, strFile}, 2)).booleanValue();
    Test de Prueba:::::::
    public class TestDLL implements CodeIMG {
         public static void main(String[] args) {
              try {
                   CodeWER pdf = new CodeWER ( clsID );               
                   boolean ok = pdf.createImg(new ObjectRef("9999999"), new ObjectRef("C:\\image.bmp") );
                   System.out.println("Lo generoi bien:: " + ok );
              } catch (COMException e) {
                   e.printStackTrace();
    Espero te sirva este ejemplito sencillo de jawin
    Saludos!!!!!!!!!!!!
    att juo

  • Memory leak found in flash player active-x 'CallFunction' method.

    Hello,
    I think I found a memory leak that results from  calling the flash player active-X object's method 'CallFunction'. Each time this  method is called it seems that memory is not properly freed.
    I'm attaching here a  simple program I've made with C# that uses the shockwave flash object to load a  SWF and continuously perform calls to it using the 'CallFunction'. It also  displays the process memory so you can see how it's being increased after some  time running.
    In the zip file, under the bin/release directory, you'll find the  compiled executable and both the test SWF (CallFunctionTest.swf) and its source (AS3 file) which is  just a dummy Sprite that exposes a callable method using the ExternalInterface.  The SWF has been compiled using Flex compiler (Version 3.3.0 build 4852).
    The  leak may become more visible after some hours running. Also, it's interesting to  note that even by reloading the SWF without closing the application (by stopping  and restarting the stress in my test application) the memory is not freed.
    As a reference, in my  computer (Intel Dual core E2180 @ 2Ghz) the test application's virtual memory  (VM64) increased from 192MB to 480MB in 4 hours. In Windows XP 32-bit when this value reaches 2GB the process runs out of memory and the application crashes.
    Does anyone experienced the same problem?
    I have Flash Player version 10,0,32,18 installed.
    Thanks,
    Joan

    Hi,
    I found this problem recently.
    I embedded Flash in my Visual C++ project through ActiveX, and intensively call
    ShockwaveFlashObjects::IShockwaveFlash::CallFunction().
    It seems that every time I invoke this function, the memory usage of my program increase about 8kB, and never goes back again. I think this is caused by the internal memory leak in Flash.
    Does adobe have any plan to fix this issue?
    Alvin. C. Chung

  • RMI method invocation leading to Memory Leak

    My application uses RMI for communicating between two java processes.
    I'm observing some kind of memory leak in one of the classes in RMI
    library. When observed through OptimizeIT, I see a large number of
    Object[] being created by the ClassDefiner.defineClass() &
    ClassDefiner$1().run().
    These Object[] arrays keep accumulating, never get garbage collected.
    Attached is the screen shot of OptimizeIT, which shows object allocation
    hierarchy.
    Any help in this regard would be appreciated.
    The JDK version being used is, 1.4.2_05.
    thanks in advance.
    Vijayendra

    The reason for this was found to be "-Xnoclassgc" After removing this option from the startup script, I didn't notice any increase in object[]/int[] count.
    Hoping this would fix the issue.

  • Memory leak in JSpinner implementation (maybe others?)

    Hi,
    I am developing an application using Java and Swing, and have run into some problems with memory leaks. After examining the source code and making an example program (provided below), I can only come to the conclusion that there is a bug in the implementation of JSpinner in Sun Java 1.6.0_03.
    If one uses a custom model with the JSpinner, it attaches itself as a listener to the model. However, it never removes the listening connection, even if the model is changed. This causes the JSpinner to be kept in memory as long as the model exists, even if all other references to the component have been removed.
    An example program is available at http://eddie.dy.fi/~sampo/ModelTest.java . It is a simple swing program that has the JSpinner and two buttons, the first of which writes to stdout the listeners of the original model and the second changes the spinner model to a newly-created model. A sample output is below:
    Running on 1.6.0_03 from Sun Microsystems Inc.
    Listeners before connecting to JSpinner:
      Model value is 0, 0 listeners connected:
    Listeners after connecting to JSpinner:
      Model value is 0, 2 listeners connected:
      1: interface javax.swing.event.ChangeListener
      2: javax.swing.JSpinner$ModelListener@9971ad
    Listeners now:
      Model value is 8, 2 listeners connected:
      1: interface javax.swing.event.ChangeListener
      2: javax.swing.JSpinner$ModelListener@9971ad
    Changing spinner model.
    Listeners now:
      Model value is 8, 2 listeners connected:
      1: interface javax.swing.event.ChangeListener
      2: javax.swing.JSpinner$ModelListener@9971adThis shows that even though the model of the JSpinner has been changed, it still listens to the original model. I haven't looked at other components whether they retain connections to the old models as well.
    In my case, I have an adaptor-model which provides a SpinnerModel interface to the actual data. The adaptor is implemented so that it listens to the underlying model only when it itself is being listened to. If the JComponents using the model were to remove the listening connections, it, too, would be automatically garbage-collected. However, since JSpinner does not remove the connections, the adaptor also continues to listen to the underlying model, and neither can be garbage-collected.
    All in all, the listener-connections seem to be a very easy place to make memory leaks in Java and especially in Swing. However, as I see it, it would be a simple matter to make everything work automatically with one simple rule: Listen to the models only when necessary.
    If a component is hidden (or alternatively has no contact to a parent JFrame or equivalent), it does not need to listen to the model and should remove the connections. When the component is again set visible (or connected to a frame) it can re-add the connections and re-read the current model values just as it does when initializing the component. Similarly, any adaptor-models should listen to the underlying model only when it itself is being listened to.
    If the components were implemented in this way, one could simply remove a component from the frame and throw it away, and automatically any listener-connections will be removed and it can be garbage-collected. Similarly any adaptor-models are collected when they are no longer in use.
    Changing the API implementation in this way would not require any changes to applications, as the only thing that changes are the listener-connections. Currently used separate connection-removing methods should still work, though they would be unnecessary any more. The API would look exactly the same from the view of an application programmer, only that she would not need to care about remnant listening connections. (As far as I can tell, the current API specification would allow the API to be implemented as described above, but it should of course require it to be implemented in such a way.)
    Am I missing something, or is there some valid reason why the API is not implemented like this?
    PS. I'm new to these forums, so if there is a better place to post these reports, please tell me. Thanks.

    Another cognition: It's the following code, that causes the memory to be accumulated:
    obj = m_orb.resolve_initial_references("NameService");
    ctx = NamingContextExtHelper.narrow(obj);For the first 4 calls to this code the memory usage of the nameservice is unchanged. From the 5th to the 8th call, it's increased by approx. 10KB per call. And thenceforward (beginning with the 9th call) it's increasing by approx. 10MB.
    What's going wrong here?

  • Allocated memory pool was not deleted! 1 GB memory leak is too much for me!

    Dear Sirs. I found that DB environment, that was configured to use 1 GB cache size, won't free it when closed! Why? First I tried to open and close environment and got the following:
    Detected memory leaks!
    Dumping objects ->
    {596} normal block at 0x01970040, 1048596 bytes long.
    Data: < > 14 00 10 00 DB DB DB DB 0B 00 10 00 01 00 00 00
    {578} normal block at 0x00397978, 464 bytes long.
    Data: < > D0 01 00 00 DB DB DB DB C7 01 00 00 01 00 00 00
    Object dump complete.
    I have and idea that BDB will reuse the memory, rite? OK, let's try to create the same environment and open it. After environment was opened, closed, opened again and again closed, I got the following:
    Detected memory leaks!
    Dumping objects ->
    {3663} normal block at 0x01B80040, 1048596 bytes long.
    Data: < > 14 00 10 00 DB DB DB DB 0B 00 10 00 01 00 00 00
    {3645} normal block at 0x00396E60, 464 bytes long.
    Data: < > D0 01 00 00 DB DB DB DB C7 01 00 00 01 00 00 00
    {596} normal block at 0x01970040, 1048596 bytes long.
    Data: < > 14 00 10 00 DB DB DB DB 0B 00 10 00 01 00 00 00
    {578} normal block at 0x00397978, 464 bytes long.
    Data: < > D0 01 00 00 DB DB DB DB C7 01 00 00 01 00 00 00
    Object dump complete.
    So memory was not reused, nor deallocated.
    By the way, you may be interested in other leak I found, but fixed, see
    Replication manager memory leak when setting local site information.
    This leak is more serious, I am not sure I will fix it quickly. Maybe I'm doing something wrong? Could you please suggest something?
    Thanks in advance!
    With regards,
    Vladislav.

    OK, the problem solved by fixing code in file 'log.c', method '__log_dbenv_refresh'.
    Just added the code that deallocates memory of bulk buffer.
    if (IS_ENV_REPLICATED(dbenv))
    if (lp->bulk_buf != INVALID_ROFF)
    __db_shalloc_free(&dblp->reginfo, lp->bulk_buf);
    lp->bulk_buf = INVALID_ROFF;
    lp->bulk_len = 0;
    lp->bulk_off = 0;
    It was allocated in the '__log_open' function, by the following code:
              lp->ready_lsn = lp->lsn;
              if (IS_ENV_REPLICATED(dbenv)) {
                   if ((ret = __db_shalloc(&dblp->reginfo, MEGABYTE, 0,
                   &bulk)) != 0)
                        goto err;
                   lp->bulk_buf = R_OFFSET(&dblp->reginfo, bulk);
                   lp->bulk_len = MEGABYTE;
                   lp->bulk_off = 0;
              } else {
                   lp->bulk_buf = INVALID_ROFF;
                   lp->bulk_len = 0;
                   lp->bulk_off = 0;
    Sorry for time taken to read my posts, I was really needy in quick help, but solved problems myself.

  • Pro*c multithreaded application has memory leak

    Hi there,
    I posted this message a week ago in OCI section, nobody answer me.
    I am really curious if my application has a bug or the pro*c has a bug.
    Anyone can compile the sample code and test it easily.
    I made multithreaded application which queries dynamic SQL, it works.
    But the memory leaks when i query the SQL statement.
    The more memory leaks, the more i query the SQL statement, even same SQL
    statement.
    I check it with top, shell command.
    My machine is SUN E450, Solaris 8. Oracle 9.2.0.1
    Compiler : gcc (GCC) 3.2.2
    I changed source code which is from
    $(ORACLE_HOME)/precomp/demo/proc/sample10.pc
    the sample10 doesn't need to be multithreaded. But i think it has to work
    correctly if i changed it to multithreaded application.
    the make file and source code will be placed below.
    I have to figure out the problem.
    Please help
    Thanks in advance,
    the make file is below
    HOME = /user/jkku
    ORA = $(ORACLE_HOME)
    CC = gcc
    PROC = proc
    LC_INCL = -I$(HOME)/work/dbmss/libs/include
    lc_incl = include=$(HOME)/work/dbmss/libs/include
    SYS_INCL =
    sys_incl =
    ORA_INCL = -I. \
    -I$(ORA)/precomp/public \
    -I$(ORA)/rdbms/public \
    -I$(ORA)/rdbms/demo \
    -I$(ORA)/rdbms/pbsql/public \
    -I$(ORA)/network/public \
    -DSLMXMX_ENABLE -DSLTS_ENABLE -D_SVID_GETTOD
    INCLUDES = $(LC_INCL) $(SYS_INCL) $(ORA_INCL)
    includes = $(lc_incl) $(sys_incl)
    LC_LIBS =
    SYS_LIBS = -lpthread -lsocket -lnsl -lrt
    ORA_LIBS = -L$(ORA)/lib/ -lclntsh
    LIBS = $(LC_LIBS) $(SYS_LIBS) $(ORA_LIBS)
    # Define C Compiler flags
    CFLAGS += -D_Solaris64_ -m64
    CFLAGS += -g -D_REENTRANT
    # Define pro*c Compiler flags
    PROCFLAGS += THREADS=YES
    PROCFLAGS += CPOOL=YES
    # Our object files
    PRECOMPS = sample10.c
    OBJS = sample10.o
    .SUFFIXES: .o .c .pc
    .c.o:
    $(CC) -c $(CFLAGS) $(INCLUDES) $*.c
    .pc.c:
    $(PROC) $(PROCFLAGS) $(includes) $*.pc $*.c
    all: sample10
    sample10: $(PRECOMPS) $(OBJS)
    $(CC) $(CFLAGS) -o sample10 $(OBJS) $(LIBS)
    clean:
    rm -rf *.o sample10 sample10.c
    the source code is below which i changed the oracle sample10.pc to
    multithreaded application.
    Sample Program 10: Dynamic SQL Method 4
    This program connects you to ORACLE using your username and
    password, then prompts you for a SQL statement. You can enter
    any legal SQL statement. Use regular SQL syntax, not embedded SQL.
    Your statement will be processed. If it is a query, the rows
    fetched are displayed.
    You can enter multi-line statements. The limit is 1023 characters.
    This sample program only processes up to MAX_ITEMS bind variables and
    MAX_ITEMS select-list items. MAX_ITEMS is #defined to be 40.
    #include <stdio.h>
    #include <string.h>
    #include <setjmp.h>
    #include <sqlda.h>
    #include <stdlib.h>
    #include <sqlcpr.h>
    /* Maximum number of select-list items or bind variables. */
    #define MAX_ITEMS 40
    /* Maximum lengths of the names of the
    select-list items or indicator variables. */
    #define MAX_VNAME_LEN 30
    #define MAX_INAME_LEN 30
    #ifndef NULL
    #define NULL 0
    #endif
    /* Prototypes */
    #if defined(__STDC__)
    void sql_error(void);
    int oracle_connect(void);
    int alloc_descriptors(int, int, int);
    int get_dyn_statement(void);
    void set_bind_variables(void);
    void process_select_list(void);
    void help(void);
    #else
    void sql_error(/*_ void _*/);
    int oracle_connect(/*_ void _*/);
    int alloc_descriptors(/*_ int, int, int _*/);
    int get_dyn_statement(/* void _*/);
    void set_bind_variables(/*_ void -*/);
    void process_select_list(/*_ void _*/);
    void help(/*_ void _*/);
    #endif
    char *dml_commands[] = {"SELECT", "select", "INSERT", "insert",
    "UPDATE", "update", "DELETE", "delete"};
    EXEC SQL INCLUDE sqlda;
    EXEC SQL INCLUDE sqlca;
    EXEC SQL BEGIN DECLARE SECTION;
    char dyn_statement[1024];
    EXEC SQL VAR dyn_statement IS STRING(1024);
    EXEC SQL END DECLARE SECTION;
    EXEC ORACLE OPTION (ORACA=YES);
    EXEC ORACLE OPTION (RELEASE_CURSOR=YES);
    SQLDA *bind_dp;
    SQLDA *select_dp;
    /* Define a buffer to hold longjmp state info. */
    jmp_buf jmp_continue;
    char *db_uid="dbmuser/dbmuser@dbmdb";
    sql_context ctx;
    int err_sql;
    enum{
    SQL_SUCC=0,
    SQL_ERR,
    SQL_NOTFOUND,
    SQL_UNIQUE,
    SQL_DISCONNECT,
    SQL_NOTNULL
    int main()
    int i;
    EXEC SQL ENABLE THREADS;
    EXEC SQL WHENEVER SQLERROR DO sql_error();
    EXEC SQL WHENEVER NOT FOUND DO sql_not_found();
    /* Connect to the database. */
    if (connect_database() < 0)
    exit(1);
    EXEC SQL CONTEXT USE :ctx;
    /* Process SQL statements. */
    for (;;)
    /* Allocate memory for the select and bind descriptors. */
    if (alloc_descriptors(MAX_ITEMS, MAX_VNAME_LEN, NAME_LEN) != 0)
    exit(1);
    (void) setjmp(jmp_continue);
    /* Get the statement. Break on "exit". */
    if (get_dyn_statement() != 0)
    break;
    EXEC SQL PREPARE S FROM :dyn_statement;
    EXEC SQL DECLARE C CURSOR FOR S;
    /* Set the bind variables for any placeholders in the
    SQL statement. */
    set_bind_variables();
    /* Open the cursor and execute the statement.
    * If the statement is not a query (SELECT), the
    * statement processing is completed after the
    * OPEN.
    EXEC SQL OPEN C USING DESCRIPTOR bind_dp;
    /* Call the function that processes the select-list.
    * If the statement is not a query, this function
    * just returns, doing nothing.
    process_select_list();
    /* Tell user how many rows processed. */
    for (i = 0; i < 8; i++)
    if (strncmp(dyn_statement, dml_commands, 6) == 0)
    printf("\n\n%d row%c processed.\n", sqlca.sqlerrd[2], sqlca.sqlerrd[2] == 1 ? '\0' : 's');
    break;
    /* Close the cursor. */
    EXEC SQL CLOSE C;
    /* When done, free the memory allocated for pointers in the bind and
    select descriptors. */
    for (i = 0; i < MAX_ITEMS; i++)
    if (bind_dp->V != (char *) 0)
    free(bind_dp->V);
    free(bind_dp->I); /* MAX_ITEMS were allocated. */
    if (select_dp->V != (char *) 0)
    free(select_dp->V);
    free(select_dp->I); /* MAX_ITEMS were allocated. */
    /* Free space used by the descriptors themselves. */
    SQLSQLDAFree(ctx, bind_dp);
    SQLSQLDAFree(ctx, select_dp);
    } /* end of for(;;) statement-processing loop */
    disconnect_database();
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    EXEC SQL COMMIT WORK RELEASE;
    puts("\nHave a good day!\n");
    return;
    * Allocate the BIND and SELECT descriptors using sqlald().
    * Also allocate the pointers to indicator variables
    * in each descriptor. The pointers to the actual bind
    * variables and the select-list items are realloc'ed in
    * the set_bind_variables() or process_select_list()
    * routines. This routine allocates 1 byte for select_dp->V
    * and bind_dp->V, so the realloc will work correctly.
    alloc_descriptors(size, max_vname_len, max_iname_len)
    int size;
    int max_vname_len;
    int max_iname_len;
    int i;
    * The first sqlald parameter determines the maximum number of
    * array elements in each variable in the descriptor. In
    * other words, it determines the maximum number of bind
    * variables or select-list items in the SQL statement.
    * The second parameter determines the maximum length of
    * strings used to hold the names of select-list items
    * or placeholders. The maximum length of column
    * names in ORACLE is 30, but you can allocate more or less
    * as needed.
    * The third parameter determines the maximum length of
    * strings used to hold the names of any indicator
    * variables. To follow ORACLE standards, the maximum
    * length of these should be 30. But, you can allocate
    * more or less as needed.
    if ((bind_dp =
    SQLSQLDAAlloc(ctx, size, max_vname_len, max_iname_len)) ==
    (SQLDA *) 0)
    fprintf(stderr,
    "Cannot allocate memory for bind descriptor.");
    return -1; /* Have to exit in this case. */
    if ((select_dp =
    SQLSQLDAAlloc(ctx, size, max_vname_len, max_iname_len)) == (SQLDA *)
    0)
    fprintf(stderr,
    "Cannot allocate memory for select descriptor.");
    return -1;
    select_dp->N = MAX_ITEMS;
    /* Allocate the pointers to the indicator variables, and the
    actual data. */
    for (i = 0; i < MAX_ITEMS; i++) {
    bind_dp->I = (short *) malloc(sizeof (short));
    select_dp->I = (short *) malloc(sizeof(short));
    bind_dp->V = (char *) malloc(1);
    select_dp->V = (char *) malloc(1);
    return 0;
    int get_dyn_statement()
    char *cp, linebuf[256];
    int iter, plsql;
    for (plsql = 0, iter = 1; ;)
    if (iter == 1)
    printf("\nSQL> ");
    dyn_statement[0] = '\0';
    fgets(linebuf, sizeof linebuf, stdin);
    cp = strrchr(linebuf, '\n');
    if (cp && cp != linebuf)
    *cp = ' ';
    else if (cp == linebuf)
    continue;
    if ((strncmp(linebuf, "EXIT", 4) == 0) ||
    (strncmp(linebuf, "exit", 4) == 0))
    return -1;
    else if (linebuf[0] == '?' ||
    (strncmp(linebuf, "HELP", 4) == 0) ||
    (strncmp(linebuf, "help", 4) == 0))
    help();
    iter = 1;
    continue;
    if (strstr(linebuf, "BEGIN") ||
    (strstr(linebuf, "begin")))
    plsql = 1;
    strcat(dyn_statement, linebuf);
    if ((plsql && (cp = strrchr(dyn_statement, '/'))) ||
    (!plsql && (cp = strrchr(dyn_statement, ';'))))
    *cp = '\0';
    break;
    else
    iter++;
    printf("%3d ", iter);
    return 0;
    void set_bind_variables()
    int i, n;
    char bind_var[64];
    /* Describe any bind variables (input host variables) */
    EXEC SQL WHENEVER SQLERROR DO sql_error();
    bind_dp->N = MAX_ITEMS; /* Initialize count of array elements. */
    EXEC SQL DESCRIBE BIND VARIABLES FOR S INTO bind_dp;
    /* If F is negative, there were more bind variables
    than originally allocated by sqlald(). */
    if (bind_dp->F < 0)
    printf ("\nToo many bind variables (%d), maximum is %d\n.",
    -bind_dp->F, MAX_ITEMS);
    return;
    /* Set the maximum number of array elements in the
    descriptor to the number found. */
    bind_dp->N = bind_dp->F;
    /* Get the value of each bind variable as a
    * character string.
    * C contains the length of the bind variable
    * name used in the SQL statement.
    * S contains the actual name of the bind variable
    * used in the SQL statement.
    * L will contain the length of the data value
    * entered.
    * V will contain the address of the data value
    * entered.
    * T is always set to 1 because in this sample program
    * data values for all bind variables are entered
    * as character strings.
    * ORACLE converts to the table value from CHAR.
    * I will point to the indicator value, which is
    * set to -1 when the bind variable value is "null".
    for (i = 0; i < bind_dp->F; i++)
    printf ("\nEnter value for bind variable %.*s: ",
    (int)bind_dp->C, bind_dp->S);
    fgets(bind_var, sizeof bind_var, stdin);
    /* Get length and remove the new line character. */
    n = strlen(bind_var) - 1;
    /* Set it in the descriptor. */
    bind_dp->L = n;
    /* (re-)allocate the buffer for the value.
    sqlald() reserves a pointer location for
    V but does not allocate the full space for
    the pointer. */
    bind_dp->V = (char *) realloc(bind_dp->V, (bind_dp->L + 1));
    /* And copy it in. */
    strncpy(bind_dp->V, bind_var, n);
    /* Set the indicator variable's value. */
    if ((strncmp(bind_dp->V, "NULL", 4) == 0) ||
    (strncmp(bind_dp->V, "null", 4) == 0))
    *bind_dp->I = -1;
    else
    *bind_dp->I = 0;
    /* Set the bind datatype to 1 for CHAR. */
    bind_dp->T = 1;
    return;
    void process_select_list()
    int i, null_ok, precision, scale;
    if ((strncmp(dyn_statement, "SELECT", 6) != 0) &&
    (strncmp(dyn_statement, "select", 6) != 0))
    select_dp->F = 0;
    return;
    /* If the SQL statement is a SELECT, describe the
    select-list items. The DESCRIBE function returns
    their names, datatypes, lengths (including precision
    and scale), and NULL/NOT NULL statuses. */
    select_dp->N = MAX_ITEMS;
    EXEC SQL DESCRIBE SELECT LIST FOR S INTO select_dp;
    /* If F is negative, there were more select-list
    items than originally allocated by sqlald(). */
    if (select_dp->F < 0)
    printf ("\nToo many select-list items (%d), maximum is %d\n",
    -(select_dp->F), MAX_ITEMS);
    return;
    /* Set the maximum number of array elements in the
    descriptor to the number found. */
    select_dp->N = select_dp->F;
    /* Allocate storage for each select-list item.
    sqlprc() is used to extract precision and scale
    from the length (select_dp->L).
    sqlnul() is used to reset the high-order bit of
    the datatype and to check whether the column
    is NOT NULL.
    CHAR datatypes have length, but zero precision and
    scale. The length is defined at CREATE time.
    NUMBER datatypes have precision and scale only if
    defined at CREATE time. If the column
    definition was just NUMBER, the precision
    and scale are zero, and you must allocate
    the required maximum length.
    DATE datatypes return a length of 7 if the default
    format is used. This should be increased to
    9 to store the actual date character string.
    If you use the TO_CHAR function, the maximum
    length could be 75, but will probably be less
    (you can see the effects of this in SQL*Plus).
    ROWID datatype always returns a fixed length of 18 if
    coerced to CHAR.
    LONG and
    LONG RAW datatypes return a length of 0 (zero),
    so you need to set a maximum. In this example,
    it is 240 characters.
    printf ("\n");
    for (i = 0; i < select_dp->F; i++)
    char title[MAX_VNAME_LEN];
    /* Turn off high-order bit of datatype (in this example,
    it does not matter if the column is NOT NULL). */
    sqlnul ((unsigned short *)&(select_dp->T), (unsigned short
    *)&(select_dp->T), &null_ok);
    switch (select_dp->T)
    case 1 : /* CHAR datatype: no change in length
    needed, except possibly for TO_CHAR
    conversions (not handled here). */
    break;
    case 2 : /* NUMBER datatype: use sqlprc() to
    extract precision and scale. */
    sqlprc ((unsigned int *)&(select_dp->L), &precision,
    &scale);
    /* Allow for maximum size of NUMBER. */
    if (precision == 0) precision = 40;
    /* Also allow for decimal point and
    possible sign. */
    /* convert NUMBER datatype to FLOAT if scale > 0,
    INT otherwise. */
    if (scale > 0)
    select_dp->L = sizeof(float);
    else
    select_dp->L = sizeof(int);
    break;
    case 8 : /* LONG datatype */
    select_dp->L = 240;
    break;
    case 11 : /* ROWID datatype */
    case 104 : /* Universal ROWID datatype */
    select_dp->L = 18;
    break;
    case 12 : /* DATE datatype */
    select_dp->L = 9;
    break;
    case 23 : /* RAW datatype */
    break;
    case 24 : /* LONG RAW datatype */
    select_dp->L = 240;
    break;
    /* Allocate space for the select-list data values.
    sqlald() reserves a pointer location for
    V but does not allocate the full space for
    the pointer. */
    if (select_dp->T != 2)
    select_dp->V = (char *) realloc(select_dp->V,
    select_dp->L + 1);
    else
    select_dp->V = (char *) realloc(select_dp->V,
    select_dp->L);
    /* Print column headings, right-justifying number
    column headings. */
    /* Copy to temporary buffer in case name is null-terminated */
    memset(title, ' ', MAX_VNAME_LEN);
    strncpy(title, select_dp->S, select_dp->C);
    if (select_dp->T == 2)
    if (scale > 0)
    printf ("%.*s ", select_dp->L+3, title);
    else
    printf ("%.*s ", select_dp->L, title);
    else
    printf("%-.*s ", select_dp->L, title);
    /* Coerce ALL datatypes except for LONG RAW and NUMBER to
    character. */
    if (select_dp->T != 24 && select_dp->T != 2)
    select_dp->T = 1;
    /* Coerce the datatypes of NUMBERs to float or int depending on
    the scale. */
    if (select_dp->T == 2)
    if (scale > 0)
    select_dp->T = 4; /* float */
    else
    select_dp->T = 3; /* int */
    printf ("\n\n");
    /* FETCH each row selected and print the column values. */
    EXEC SQL WHENEVER NOT FOUND GOTO end_select_loop;
    for (;;)
    EXEC SQL FETCH C USING DESCRIPTOR select_dp;
    /* Since each variable returned has been coerced to a
    character string, int, or float very little processing
    is required here. This routine just prints out the
    values on the terminal. */
    for (i = 0; i < select_dp->F; i++)
    if (*select_dp->I < 0)
    if (select_dp->T == 4)
    printf ("%-*c ",(int)select_dp->L+3, ' ');
    else
    printf ("%-*c ",(int)select_dp->L, ' ');
    else
    if (select_dp->T == 3) /* int datatype */
    printf ("%*d ", (int)select_dp->L,
    *(int *)select_dp->V);
    else if (select_dp->T == 4) /* float datatype */
    printf ("%*.2f ", (int)select_dp->L,
    *(float *)select_dp->V);
    else /* character string */
    printf ("%-*.*s ", (int)select_dp->L,
    (int)select_dp->L, select_dp->V);
    printf ("\n");
    end_select_loop:
    return;
    void help()
    puts("\n\nEnter a SQL statement or a PL/SQL block at the SQL> prompt.");
    puts("Statements can be continued over several lines, except");
    puts("within string literals.");
    puts("Terminate a SQL statement with a semicolon.");
    puts("Terminate a PL/SQL block (which can contain embedded
    semicolons)");
    puts("with a slash (/).");
    puts("Typing \"exit\" (no semicolon needed) exits the program.");
    puts("You typed \"?\" or \"help\" to get this message.\n\n");
    int connect_database()
    err_sql = SQL_SUCC;
    EXEC SQL WHENEVER SQLERROR DO sql_error();
    EXEC SQL WHENEVER NOT FOUND DO sql_not_found();
    EXEC SQL CONTEXT ALLOCATE :ctx;
    EXEC SQL CONTEXT USE :ctx;
    EXEC SQL CONNECT :db_uid;
    if(err_sql != SQL_SUCC){
    printf("err => connect database(ctx:%ld, uid:%s) failed!\n", ctx, db_uid);
    return -1;
    return 1;
    int disconnect_database()
    err_sql = SQL_SUCC;
    EXEC SQL WHENEVER SQLERROR DO sql_error();
    EXEC SQL WHENEVER NOT FOUND DO sql_not_found();
    EXEC SQL CONTEXT USE :ctx;
    EXEC SQL COMMIT WORK RELEASE;
    EXEC SQL CONTEXT FREE:ctx;
    return 1;
    void sql_error()
    printf("err => %.*s", sqlca.sqlerrm.sqlerrml, sqlca.sqlerrm.sqlerrmc);
    printf("in \"%.*s...\'\n", oraca.orastxt.orastxtl, oraca.orastxt.orastxtc);
    printf("on line %d of %.*s.\n\n", oraca.oraslnr, oraca.orasfnm.orasfnml,
    oraca.orasfnm.orasfnmc);
    switch(sqlca.sqlcode) {
    case -1: /* unique constraint violated */
    err_sql = SQL_UNIQUE;
    break;
    case -1012: /* not logged on */
    case -1089:
    case -3133:
    case -1041:
    case -3114:
    case -3113:
    /* �6�Ŭ�� shutdown�ǰų� �α��� ���°� �ƴҶ� ��b�� �õ� */
    /* immediate shutdown in progress - no operations are permitted */
    /* end-of-file on communication channel */
    /* internal error. hostdef extension doesn't exist */
    err_sql = SQL_DISCONNECT;
    break;
    case -1400:
    err_sql = SQL_NOTNULL;
    break;
    default:
    err_sql = SQL_ERR;
    break;
    EXEC SQL CONTEXT USE :ctx;
    EXEC SQL WHENEVER SQLERROR CONTINUE;
    EXEC SQL ROLLBACK WORK;
    void sql_not_found()
    err_sql = SQL_NOTFOUND;

    Hi Jane,
    What version of Berkeley DB XML are you using?
    What is your operating system and your hardware platform?
    For how long have been the application running?
    What is your current container size?
    What's set for EnvironmentConfig.setThreaded?
    Do you know if containers have previously not been closed correctly?
    Can you please post the entire error output?
    What's the JDK version, 1.4 or 1.5?
    Thanks,
    Bogdan

  • How Do I identify a Memory Leak?

    I know this is not enought information but...
    My application used 3 hashtables in a Data object to store application data. I retrive this data from an XML file. I also download XML and merge it into andother XML file. Some of these hashtables contain object that contain more hashtables.
    I am trying to use JProbe Profiler to find the leak. I notice the memory increases when I load the data into objects and put them into hash tables. I also notice an increase when I am merging newly downloaded XML into the current XML data. I am useing Nodelists and NOdes to get the data.
    Does anyone have any tips or suggestion on how to find a memory leak?
    Thank you,
    Al

    7 MB of XML file, loaded into a DOM? You realize, of
    course, that DOMs are data structures that take up
    memory, too, right?Yes I do. I load it into DOM then go through the Document and put the XML data into a custom file format (seialized objects). The data is sent from the server in the form of XML.
    There's your problem. If you load X MB into memory
    and keep it around as long as your application is
    running, that's not necessarily a "leak". Yeah I realized this but it seems that if I load 7MB of my objects into hashtables my memory usage shouldn't increase by 30MB. I just assumed it would stay around 10MB.
    The real issue is trading memory for CPU. If keeping
    them in memory is crashing your app with OOM errors,
    by all means just keep those objects in memory for as
    long as you need them and then let the GC clean them
    up. Don't put them in a Map, just let them have a
    narrow method scope. Recreate them every time you
    need them. Yes I'm beginning to see the light.
    I'm sure you're thinking, "But recreating them will
    cost CPU and slow down my app!" Yes, that's why it's
    a tradeoff between memory and CPU.
    Do you really need the whole document in memory at
    once? If you're just cherry picking a few values out
    of it, maybe you can use a SAX parser instead of a
    DOM.
    No I don't need all that data at once.
    >
    Either you're screwed or you need to rethink this.
    You'd better hope that it's really not needed at
    every moment for every client.After rethinking, I'm going to keep the serialized data in the file until I need it. Rather than searching through a hashtable for the object I want I will search the file.
    What are your JVM settings for -Xms and -Xmx? Maybe
    increasing those will do the trick.I did increase them and it helped a little, but I can still get a OutOfMemoryError if I try.
    Are you sure these are the culprits? Have you
    profiled the app to see if there are other sources of
    leaks?Yes I have been profiling the application. It seems that there is a memory leek. I am just having trouble identifing it. I know the memory increases at 2 points. When I load the XML data into the DOM and when I load the DOM into my Custom object and then into the Hashtables.
    Last resort? Buy more physical memory. It's cheap.I think I am going to keep unused data out of memory and access it form a file. After I make this change I think my memory usage will drop alot. I will profile again after I have this change made to see if there is a memory leak.
    Thanks for you help,
    Al

  • HTTPService + XML Load + Memory Leak

    Hi all....
    I have noticed a memory leak in my application. This leak was
    not apparent when the application was completed some months back
    which is what left me a little confused as all I have done since
    was upgrade to Flex 3 and possibly updated / changed my Flash
    player.
    I think I have found the cause to this problem (below) but am
    not 100% sure that it is the "actual" problem or any reasons to
    back my thoughts up, so have listed what I have checked / tried
    along the way (maybe I have missed something)....
    My Discovery Process:
    I started profiling my application but did not find anything
    out of the ordinary. I did a code walk-through double checking I
    had cleaned up after myself, removing and even nulling all items
    etc but still to now success - the leak is still there.
    I have profiled the app in the profiler for reasonably long
    periods of time.
    All the classes etc being used within the app are consistent
    in size and instance amount and there is no sign of any apparent
    leak.
    I am using a HTTPService that is loading XML data which I am
    refreshing every 5 seconds. On this 5 second data refresh some
    class instances are incremented but are restored to the expected
    amount after a GC has occurred. The GC seems to take longer, the
    longer the app is running, therefore more and more instances are
    being added to the app, but when the GC eventually runs it "seems"
    to clear these instances to the expected amount.
    After scratching my head for a while I decided to make a copy
    of my application, rip everything out, and focus in my data load,
    where I found a problem!
    I have now just a HTTPService that loads an XML file every 5
    seconds, and this is all I currently have in the app (as I ripped
    the rest of the code out), e.g:
    Code:
    <mx:Application xmlns:mx="
    http://www.adobe.com/2006/mxml"
    ....... creationComplete="initApp()" >
    <mx:HTTPService
    id="httpServiceResults"
    url="
    http://myIP:myPort/myRoot/myXML.cfm"
    resultFormat="e4x"
    result="httpResultHandler(event)" />
    <script....... >
    private var timerPulse:Timer;
    private function initApp():void
    httpServiceResults.send();
    timerPulse = new Timer(5000, 0);
    private function httpResultHandler(event:ResultEvent):void
    timerPulse.start();
    timerPulse.addEventListener(TimerEvent.TIMER, timerRefresh);
    public function timerRefresh(eventObj:TimerEvent):void
    timerPulse.stop();
    timerPulse.removeEventListener(TimerEvent.TIMER,
    timerRefresh);
    timerPulse.reset();
    httpServiceResults.send();
    </script>
    </mx:Application>
    This is pretty much the code I am currently using and it
    leaks.
    I ran and monitored this in both the profiler and the
    activity / task manager, and after running the app for 1800 seconds
    (30 min) in the profiler, the memory size grew from 50mg to 165mg
    just sending the HTTPService.
    I tried loading the service in multiple ways including in AS
    rather than MXML creating new instances of it each time, resetting
    it, nulling it etc... but nothing prevented this memory increase.
    I then tried to load the XML using different methods such as
    using the URLRequest and URLLoader which again caused a memory
    leak.
    What still confuses me is that this leak did not exist in the
    previous version and not a great deal has changed since then apart
    from upgrading to Flex 3 and possibly upgrading my Flash payer
    (which I believe is a possible cause)
    After looking into this issue a bit more deeply, I read a few
    blogs / forums and other people are experiencing the same problems
    - even with a lot bigger leaks in some cases all when reloading
    large sets of XML data into Flex - however, I as of yet found no
    solution to this leak - people with a similar problem believe it is
    not due to a memory leak more a GC error, and others pointing
    towards the Flash Player itself that is leaking - I don't really
    know.
    Findings so far during investigation of this issue:
    * App leaks for both HTTPService and ULRRequest / URLLoader
    methods
    * App only leaks when calling a data loader
    * The size of the leak seems to depend on the size of the
    XML being loaded
    * The size of the leak also seems to be affected by the
    applications heaviness - the greater seems to enhance the leak
    An interesting factor I have noticed is that if I copy the
    XML from my "myXML.cfm" that I link to in my HTTPService and copy
    the contents of the file into my own XML file stored within the
    Flex project root itself: ""myXML.xml"" the leak disappears... like
    it seems to link when loading the XML over a network, however as my
    network knowledge is not great I am not sure what to make of this -
    any ideas???
    Could the connection to the XML document cause leaks??? is
    there anything else that could cause this leak??? have I something
    in my code sample that could cause this leak??? or could any of the
    other things I have mentioed cause this leak???
    Any help / ideas would be greatly appreciated.
    Thanks,
    Jon.

    I also observed heavy memory leak from using httpservice with
    XML data. I am using Flex3 builder under Linux. My Flex application
    polls httpservice every 10 seconds. The reply is a short XML
    message less than 100 bytes. This simple polling will consume 30+
    MB of memory every hour. I leave it idling for several hours and it
    took 200 MB of memory. No sign of garbage collection at all.

  • Memory Leak In DataService

    Hi All,
          I had posted this query to couple of other groups ..I am still struglling with this issue..Hope someone  will  help me out here
          I have  very basic application which uses  DataSerives over RTMP channel  to populate dataGrid , I have not used any  user defined component.
    This application has got LOAD data and Remove data  Button just to simulate the actual application
    What happens , when I click on LOAD data , It  loads the data from server(JBOSS) then I Remove all the data and force the GC to run
    If I continuously keep loading and removing the  data ,  memory goes up every time and after some times It reaches to threshold and  finally crashes the Browser.
    In actual application as soon as user logs in a dedicated DS destination is created..
        private function createDestination(destName:String):void{
                 var remoteService:RemoteObject = new RemoteObject("DestinationManager");
                 remoteService.addEventListener(ResultEvent.RESULT, resultHandler,false,0,true);
                 var operation:AbstractOperation = remoteService.getOperation("createDestination");
                 operation.send(destName);
                 var cs:ChannelSet = new ChannelSet();
                 var rtmpChannel:RTMPChannel = ServerConfig.getChannel("my-rtmp") as  RTMPChannel;
                 cs.addChannel(rtmpChannel);
                 tradeService = new DataService() ;
                 tradeService.destination=destName;
                 tradeService.channelSet = cs;  
    Now when user hits on Load data button to load the trade data ...
       public function loadData():void
             var remoteService:RemoteObject  = new RemoteObject("filterRemoteVO");
             var operation:AbstractOperation = remoteService.getOperation("loadData");
             tradeService.fill(tradeCollection);
             operation.send(rowData.text ,GUIID);
             tradeList.dataProvider = tradeCollection;
    Remove Data  hit I clean all the resource and released collection :-
          public  function  removeAll():void{
             if(tradeList.dataProvider){
                  tradeCollection.source = new Array();
                  tradeList.dataProvider.source = new Array();
                  tradeList.dataProvider = null;
                tradeService.release();
               tradeService.releaseCollection(tradeCollection);
              tradeService.channelSet.disconnectAll();
              tradeService.disconnect();
               tradeService.logout();
               System.gc();
    Except these 3 function I don't have any code which could cause memory leak.
    I m using
    LCDS 2.5
    Flex 3.0
    JBoss4.2
    Please see the mxml file below   , If  possible please have a look at it , I might  not be using dataSerice API correctly.
    I have been trying to solve this leak for last two week , I really need help from you guys.
    My client has already evaluating other contemporary technology because of this memory issue.
    I have also created scalled down war file which can be deployed on any  java application server.
    Any help will greatly be appreciated
    Regards,
    Dam
    ######################## MXML##########################
    <?xml version="1.0" encoding="utf-8"?>
    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute"
          creationComplete="init();" height="100%" width="100%"
         >
         <mx:Script >
         <![CDATA[
             import mx.containers.GridRow;
               import mx.utils.Base64Decoder;
             import mx.utils.StringUtil;
                import mx.events.CollectionEvent;
             import mx.formatters.Formatter;
             import mx.events.ResizeEvent;
             import mx.controls.DataGrid;
             import mx.effects.Fade;
             import mx.events.DataGridEvent;
             import mx.utils.ObjectUtil;
             import mx.events.ScrollEvent;
           import mx.formatters.DateFormatter;
           import mx.events.ListEvent;
           import mx.data.mxml.DataService;
           import mx.messaging.config.ServerConfig;
           import mx.messaging.channels.RTMPChannel;
           import mx.messaging.ChannelSet;
           import mx.rpc.AbstractOperation;
           import mx.rpc.remoting.RemoteObject;
           import mx.collections.ArrayCollection;
           import mx.controls.Alert;
           import mx.rpc.events.ResultEvent;
           import mx.messaging.messages.*;
           import mx.messaging.events.*;
           import mx.controls.Alert;
            private var GUIID:String;
            private var lastRollOverIndex:Number;
            public var tradeService:DataService=null;
            public var tradeCollection:ArrayCollection = new ArrayCollection();
           public var flag:Boolean = false;
            private function init():void {
               var guiId:String ="TEST";
                createDestination(GUIID);
            public function getData():void{
                 // memory.text =""+ ((System.totalMemory / 1024)/1024);
            public function releaseDataServices():void {
               //  tradeService.fill(null);
                    tradeService.release();
                   // tradeService.releaseCollection(tradeCollection);
                   tradeService.channelSet.disconnectAll();
                    tradeService.disconnect();
                    tradeService.logout();
                    //tradeService.dataStore = null;
                    /*Function for creating destination*/
              private function createDestination(destName:String):void{
                 var remoteService:RemoteObject = new RemoteObject("DestinationManager");
                 remoteService.addEventListener(ResultEvent.RESULT, resultHandler,false,0,true);
                 var operation:AbstractOperation = remoteService.getOperation("createDestination");
                 operation.send(destName);
                 var cs:ChannelSet = new ChannelSet();
                 var rtmpChannel:RTMPChannel = ServerConfig.getChannel("my-rtmp") as RTMPChannel;
                 cs.addChannel(rtmpChannel);
                 tradeService = new DataService() ;
                 tradeService.destination=destName;
                 tradeService.channelSet = cs;  
             //This function calls dataservice fill method depending on wheather destination is created or not
            private function resultHandler(event:ResultEvent):void{
               //call data service as destination is created successfully
                var status:Boolean = event.result as Boolean
               // Alert.show("status="+status);
                if(status){
                 getData();
               else{
                   //TODO report error to MATS app  
          public  function  removeAll():void{
             if(tradeList.dataProvider){
                  tradeCollection.source = new Array();
                  tradeList.dataProvider.source = new Array();
                  tradeList.dataProvider = null;
                tradeService.release();
               // tradeService.releaseCollection(tradeCollection);
              tradeService.channelSet.disconnectAll();
              tradeService.disconnect();
               tradeService.logout();
               System.gc();
           public function loadData():void
             var remoteService:RemoteObject  = new RemoteObject("filterRemoteVO");
             var operation:AbstractOperation = remoteService.getOperation("loadData");
             tradeService.fill(tradeCollection);
             operation.send(rowData.text ,GUIID);
             tradeList.dataProvider = tradeCollection;
       ]]>
    </mx:Script>
          <mx:DataGrid   id="tradeList"
                 initialize="tradeList.dataProvider = tradeCollection" horizontalScrollPolicy="auto"
                   height="659" x="0" y="84">
                <mx:columns>
                     <mx:DataGridColumn  headerText="Security Description" dataField="securityDesc"
                      />
                     <mx:DataGridColumn  headerText="B/S" dataField="transactionType"
                     />
                     <mx:DataGridColumn  headerText="Amount" dataField="amount"
                     />
                     <mx:DataGridColumn  headerText="Price Text" dataField="priceText"
                     />
                     <mx:DataGridColumn  headerText="Counterparty" dataField="counterParty"
                     />
                     <mx:DataGridColumn  headerText="Trade Date" dataField="tradeDate"
                     />
                     <mx:DataGridColumn  headerText="Settle Date" dataField="settleDate"
                     />
                     <mx:DataGridColumn  headerText="Trade Status" dataField="tradeStatusId"
                     />
                     <mx:DataGridColumn  headerText="Trader" dataField="trader"
                     />
                     <mx:DataGridColumn  headerText="Salesperson" dataField="salesperson"
                     />
                     <mx:DataGridColumn  headerText="Ticket Number" dataField="tradeNumber"
                     />
                     <mx:DataGridColumn  headerText="Entry Date" dataField="tradeTime"
                     />
                     <mx:DataGridColumn  headerText="Cancel Date" dataField="cancelDate"
                     />
                     <mx:DataGridColumn  headerText="Cancel Time" dataField="cancelTime"
                     />
                 </mx:columns>
              </mx:DataGrid >
             <mx:Grid x="149" y="23" width="995">
                     <mx:GridRow width="100%" height="100%">
                                <mx:GridItem width="100%" height="100%">
                                     <mx:Label text="Enter No of obejcts"   width="111"/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:TextInput name="row" id="rowData"   width="97"/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:Button  label="Load Data" click='loadData()'/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:Button  label="removeAll" click='removeAll()'/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:Label text="Total Memory"/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:TextInput text="Total Memory" id="memory"   width="97"/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:Label text="Grid Row Count"/>
                             </mx:GridItem>
                             <mx:GridItem width="100%" height="100%">
                                     <mx:TextInput name="GridRowCountN" id="GridRowCount"   width="97"/>
                             </mx:GridItem>
                     </mx:GridRow>
             </mx:Grid>
    </mx:Application>

    Hi Natasha,
    Sorry for late reply.
          I tried your suggestion but It did not help to release memory. Actully,this app contains only one event handler which is for remote method call , I dont think this could cause any memory leak.
    Profiling session reveals that It is the issue of DataService class.I dont know How do I convince  Adobe to investigate this issue.
    Regards,
    Dharmendra

  • Memory Leak in BI SDK with XMLA Connector ?

    Hi,
    I am using BI SDK 3.5 with XMLA Connector. I noticed that in com.sap.ip.bi.sdk.dac.connector.xmla.impl.Connection class, the LocalTransaction object is rollbacked when the close() method is called.
    This makes a call to the endTransaction() method of Repository class with "true" parameter and leads to informations storage into a RepositoryDBMemory instance.
    The only way I found to avoid this is to call the endTransaction() method with "false" as parameter, which is what is done in commit() method of the LocalTransaction class.
    So, I tried to commit the transaction before closing the connection but in XMLA mode, the getLocalTransaction() method throws an BIResourceException so it is impossible to commit it. This is the first issue.
    Second issue: it seems that data hold by the DataSetContentHandler is not freed. I tried using SAP Parser, Xerces, Java Parser but it has no effect. I hava a MDX query that returns 13000 lines, the XML file size is about 15Mo.
    In a for loop with 10 operations, it leads to a OutOfMemory error quickly (only 7 iterations OK with -Xmx256m -Xms256m options). On each iteration, the memory grows about 25 to 30Mo !
    For the first point, I do not call the close method on the connection object and it is garbage collected (but, in my opinion, it is quite strange not calling the close() method on a connection object).
    For the second one (DataSetContentHandler), I have no idea. Has someone already encounter this problem ? The Netbeans profiler tells me it is this object that holds all java.lang.String objects. Is it right ?
    I saw in DataSetContentHandler class that it has two static fields: one for the row cursor of the dataset, the other one for column cursor. Why ? Is it OK in a multi-threaded context ?
    <b>This is urgent as we will not put the project in production mode with such a memory leak ! We must find the problem very quickly.</b>
    Thanks in advance for any help you might give to me !
    Regards,
    David Degardin (Ubik-Ingenierie)

    I found the same thing. Tracing the execution back I found the only place this function was called was as part of the setup, so you shouldn't have to worry about it getting called multiple times and leaking memory. The trouble seems to be when the AudioPlayer dealloc method is called, the memory is not cleaned up.
    My fix was to modify the dealloc in AudioQueueObject to check to see if audioLevels is nil and, if not, free it. This seems to have fixed the problem.

  • Memory Leak in Java Server

    Howdy Folks- I wrote a server monitor in java, which I was expecting to run for months at a time without restarting. Apparently there is some slow memory leak which results in an OutOfMemoryError after a few weeks. It's in a production system, so I can't readily add debug statements to the code, and the OutOfMemoryError apparently screwed up the logging, so I didn't get a stack trace in my logs, just an "OutOfMemoryError" went to standard out.
    I'm assuming the problem lies in the code, specifically probably some discarded reference that is not being properly garbage collected? I am using a few different ArrayLists to store some historical information, and I call clear() on these frequently. Is there any known issue with ArrayList or HashMap that the "clear()" method doesn't result in garbage collection of the objects that were in it? I am also doing a "remove(int)" sometimes as well. Any chance the objects cleared or removed would not be garbage collected?
    thanks
    Bleu

    Howdy Folks- I wrote a server monitor in java, which I
    was expecting to run for months at a time without
    restarting. Apparently there is some slow memory leak
    which results in an OutOfMemoryError after a few
    weeks. It's in a production system, so I can't
    readily add debug statements to the code, and the
    OutOfMemoryError apparently screwed up the logging, so
    I didn't get a stack trace in my logs, just an
    "OutOfMemoryError" went to standard out.Are you even attempting to catch Errors? Catching Exceptions will not help with this. It should print the stack trace. When it OOMs it doesn't mess up what's already allocated, it just can't allocate more.
    I'm assuming the problem lies in the code,
    specifically probably some discarded reference that is
    not being properly garbage collected? Most likely, there are references that are never being cleared in your code. Without seeing the code or at least having a better description, I don't think anyone here can help you. Can you set up a test senario and use an Optimizer to see what's going on?
    I am using a
    few different ArrayLists to store some historical
    information, and I call clear() on these frequently.
    Is there any known issue with ArrayList or HashMap
    that the "clear()" method doesn't result in garbage
    collection of the objects that were in it? Not that I know of, no. I doubt that is the problem.

Maybe you are looking for

  • LabVIEW Applicatio​n throws Error in Run VI Invoke node

    Hi All, We are facing an issue with an application developed from LabVIEW 2010SP1. Application Description: In our application, there is a top level VI which tries to run VIs dynamically[using Run VI invoke node] from a particular folder. This folder

  • Files downloaded turn into QuickTime files and not iTune Files!

    Hi folks, I am downloading some songs from mp3search.ru (very very cheap mp3 site) and they are downloaded as iTune files (which is what I require), however, when they download fully they become Quicktime files! I now have to change them individually

  • Pro*C compile/runtime errors w/ XMLTYPE

    On an Oracle 9iR2 NT machine (Pro*C/C++: Release 9.2.0.1.0)... 1. The following SQL works without error from SQL*Plus:      DECLARE      xml_clob CLOB;      file_name VARCHAR2(200);      BEGIN      file_name := 'rsand.xml';      xml_clob := f_get_xml

  • HT200088 how long i will wait for your update for 7 .0 .5

    how long i will wait for

  • IPad Air crossed out play button in Safari

    I am unable to watch any quicktime (mp4) embedded videos on Safari (or Chrome!) on my new iPad Air.   It shows a crossed out play button.  I have reset the cache and reset the iPad but it is still not working. I noticed this yesterday when trying to