Bookmarks
Bookmarks
Bookmark with Del.icio.us Digg it Bookmark with Furl
Submit to Reddit Bookmark with Yahoo
StumbleUpon Toolbar Bookmark with Technorati

Categories

»   Animation
»   Antiques
»   Architecture
»   Arts & Craft
»   Arts History
»   Comics
»   Dance
»   Entertainment
»   Graphic Design
»   Literature
»   Economics
»   Global Economy
»   Investing
»   Investment Banking
»   Investment Property
»   Investment Securities
»   Jobs
»   Lawyer
»   Marketing
»   Online Investment
»   Blogs
»   Desktop computer
»   Hardware
»   Internet
»   Multimedia
»   Notebook computer
»   Operating Systems
»   Robotics
»   Software
»   Arcade Game
»   Board Game
»   Card Game
»   Gambling
»   Game Cheats
»   Game Downloads
»   Kids Game
»   Online Game
»   Puzzle Game
»   Toy Game
»   Canadian Government
»   Elections
»   Federal Government
»   Government Auction
»   Government Grants
»   Government Jobs
»   Military
»   Politics
»   State Government
»   Taxes
»   Addictions
»   Aging
»   Alternative Medicine
»   Beauty
»   Cancer
»   Crohns
»   Disease
»   Fitness
»   Health Care
»   Health Food
»   Columns & Columnists
»   Internet Broadcast
»   Media
»   National News
»   News Blogs
»   Newspaper
»   Sporting News
»   Weather
»   Aviation
»   Boating
»   Bowling
»   Climbing
»   Cruise
»   Food
»   Gardening
»   Genealogy
»   Guns
»   Horoscopes
»   Almanacs
»   Bibliography
»   Dictionary
»   Directory
»   Encyclopedia
»   Journals
»   Library
»   Maps
»   Africa
»   Asia
»   North America
»   Astronomy
»   Biology
»   Chemistry
»   Earth Science
»   Environment
»   Physics
»   Psychology
»   Technology
»   Autos
»   Beauty Products
»   Clothing
»   Consumer Electronics
»   Discount shopping
»   Disney shopping
»   Gifts
»   Home and Garden
»   Home shopping
»   Online shopping
»   Education
»   Law Enforcement
»   People
»   Religion
»   Soccer
»   Baseball
»   Basketball
»   Cheerleading
»   Football
»   Golf
»   Gymnastics
»   Hockey
»   Martial Arts
»   Motorsports
Subscribe: TeamDev Support: Message List - JExplorer Demo & Samples
Add to My Yahoo! Add to Google! Add to AOL! Add to MSN Subscribe in NewsGator Online Add to Netvibes
Subscribe in Pakeflakes Subscribe in Bloglines Add to Alesti RSS Reader Add to RSS Web Reader Add To Fwicki Add to NewsBurst
Add to meta RSS Add to Windows Live Rojo RSS reader iPing-it Add to Feedage RSS Alerts Add to Feedage.com Groups
TeamDev Support: Message List - JExplorer Demo & Samples http://support.teamdev.com/rss/rssmessages.jspa?forumID=43
Feed Statistics
Views: 42 Feedage Grade B rated
Rating: 0
Adult Score: 0
Added: 2007-08-20 07:56:13
Added By: Feedage Forager
Media n
RSS Type RSS20
Tags: awt  browser  browserpanel  close  closing  event  frame  import  issue  java  jframe  memory  public  vladimir  void  webbrowser  window 
Rate this Feed:
Rate this feedRate this feedRate this feedRate this feedRate this feed
Preview: TeamDev Support: Message List - JExplorer Demo & Samples

TeamDev Support: Message List - JExplorer Demo & Samples



Most recent forum messages



Published: Mon, 25 May 2009 11:23:16 GMT2009-05-25T11:23:16Z

 

Re: Memory issue after closing a browser window

Mon, 25 May 2009 11:23:15 GMT2009-05-25T11:23:15Z

Hi Navin,


It seems like the reason in BrowserPanel.close method. Please try to change this method on the following:

public void close() {
    browser.close();
    remove(browser);
}
 

This solution solves the issue.


Regards,

Vladimir Ikryanov


Re: Memory issue after closing a browser window

Fri, 22 May 2009 20:55:41 GMT2009-05-22T20:55:41Z

Hi Navin,


I have tried your sample and I'm able to reproduce this issue. This is actually a bug in JExplorer. Thanks for reporting it.

I will look at this problem and let you know the results soon.


Regards,

Vladimir Ikryanov


Re: Memory issue after closing a browser window

Fri, 22 May 2009 17:13:43 GMT2009-05-22T17:13:43Z

Valdimir,

 

I do call the close() method of Browser in BrowserCloseListener which is a WindowListener. In the memory profiler I see reference of the window that contains the Browser panel remaining after I click the "X" button.


Re: Memory issue after closing a browser window

Fri, 22 May 2009 15:54:09 GMT2009-05-22T15:54:09Z

Hi Navin,


To dispose a WebBrowser instance you need just to invoke the WebBrowser.close method.


About this issue, could you please provide me more information about the reference you may see after disposing Browser instance?


Regards,

Vladimir Ikryanov


Re: Memory issue after closing a browser window

Fri, 22 May 2009 15:35:53 GMT2009-05-22T15:35:53Z

Ok, below are the two sample files to reproduce it. Also from the profiles it seems there is HashMap that is holding onto the parent window somewhere in "com.jniwrapper.win32.ie.di".package test;import com.jniwrapper.win32.ie.Browser;import com.jniwrapper.win32.ie.WebBrowser;import com.jniwrapper.win32.ie.event.NewWindowEventListener;import javax.swing.JPanel;import java.awt.BorderLayout;import java.awt.Container;import java.awt.Rectangle;public class BrowserPanel extends JPanel {  public static final int DEFAULT_BROWSER_WIDTH = 925;  public static final int DEFAULT_BROWSER_HEIGHT = 600;  protected final Browser browser;  public BrowserPanel() {    setLayout(new BorderLayout());    browser = new Browser();    browser.setSilent(true); // suppress the javascript error dialog    // add listener for child window    browser.addNewWindowListener(new NewWindowEventListener() {      public void windowOpened(WebBrowser webBrowser) {        Container ancestor = ((Browser) webBrowser).getTopLevelAncestor();        Rectangle rectangle = browser.getBounds();        ancestor.setBounds(rectangle.x + 10 , rectangle.y + 10, DEFAULT_BROWSER_WIDTH, DEFAULT_BROWSER_HEIGHT);        ancestor.validate();      }    });    add(browser, BorderLayout.CENTER);  }  public void load(String urlString) {    try {      browser.navigate(urlString);    } catch (Exception e) {      throw new RuntimeException(e);    }  }  public void close() {    browser.close();  }}-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------package test;import javax.swing.JFrame;import javax.swing.SwingUtilities;import javax.swing.JButton;import java.awt.Frame;import java.awt.event.WindowAdapter;import java.awt.event.WindowEvent;import java.awt.event.ActionListener;import java.awt.event.ActionEvent;public class BrowserWindowTest extends JFrame {  private final BrowserPanel browserPanel;  public BrowserWindowTest() {    browserPanel = new BrowserPanel();    setTitle("browser test");    add(browserPanel);    browserPanel.load("http://www.google.com");    setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);    addWindowListener(new BrowserCloseListener());  }  private class BrowserCloseListener extends WindowAdapter {    @Override    public void windowClosed(WindowEvent e) {                                      browserPanel.close();      System.gc(); // just for heck of it      System.out.println("size ===" + Frame.getFrames().length); // the number of frames keep increasing and never goes down.    }  }  public static void main(String[] args) {    SwingUtilities.invokeLater(new Runnable() {      @Override      public void run() {        JFrame frame = new JFrame("test");        JButton button = new JButton("open browser");        button.addActionListener(new ActionListener() {          @Override          public void actionPerformed(ActionEvent e) {            System.gc();            BrowserWindowTest embeddedBrowserWindow = new BrowserWindowTest();            embeddedBrowserWindow.setSize(400, 400);            embeddedBrowserWindow.setVisible(true);          }        });        frame.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);        frame.add(button);        frame.setSize(300, 300);        frame.setVisible(true);      }    });  }}  [...]

Memory issue after closing a browser window

Fri, 22 May 2009 14:07:25 GMT2009-05-22T14:07:25Z

I attach the browser window to a JFrame have its default operation set to dispose_on_close. When I close the window I still see that someone is holding on to the reference. I do call Borwser.close() in WindowClosed(...) event inside a WindowListener I have attached to the JFrame. Do I need to do something else? I used a profiler to see no one outside is holding on to a reference.


Re: Problem with Maximized browser

Mon, 11 May 2009 21:25:46 GMT2009-05-11T21:25:46Z

Vladimir,

Please let me know when you have a solution or workaround.

Thanks,

Navin


Re: Problem with Maximized browser

Fri, 08 May 2009 16:57:13 GMT2009-05-08T16:57:13Z

Hi,


I cannot suggest you a workaround right now . The interesting thing is that a web page is actually resized correctly, but its content is still with the same size.


Regards,

Vladimir Ikryanov


Re: Problem with Maximized browser

Fri, 08 May 2009 13:52:28 GMT2009-05-08T13:52:28Z

Vladimir,

 

Can you suggest a workaournd for now? I am thinking if I just catch window resize events and repaint the whole thing it should work. What do you think? Also when do you think we will get the fix :-)


Re: Problem with Maximized browser

Fri, 08 May 2009 13:31:29 GMT2009-05-08T13:31:29Z

Hi Navin,


Thanks for the sample. I'm able to reproduce this issue with your sample. In one of the following version of JExplorer we will fix this issue.


Regards,

Vladimir Ikryanov