Memory Leak for Graphics2D.drawString?

Hi, all!!
I am a Java Programmer who is experienced in Swing application on a windows platform.
I have developed a code snipplet to print out to use Graphics2D.drawString method.
Then, I have encountered the performance degrade that the number of objects are created per call for the method.
It seems that there is a difference among JDKs.
When such a method is called, the number of objects are created is the followings
Java1.4 | 138
Java5 | 946
Java6 | 1217
Is this a known bug that JDK has since JDK has changed graphically from Tiger?
or is it related to memory leak?
Thank you in advance
Edited by: Yuichi_Yamada on Jun 30, 2008 5:31 AM

Yuichi_Yamada wrote:
Is there a noticeable performance degradation in your application (from the user's perspective?)Compared to Java1.4, it takes 4 times longer to finish print-outs for large volume of data.Please post the example you're benchmarking. I wrote up a quick little micro-benchmark (I know I know, not a 100% accurate benchmark, but just as a quick test), and could not reproduce the performance degradation time-wise (I didn't test memory usage). In fact, with this benchmark, it appears that 1.6 is around 3x faster with Graphics#drawString() than 1.4:
Printing "Hello, world!" 500,000 times (approximate average of 10 runs):
1.4 - 5600ms
1.5 - 2300ms
1.6 - 1920ms
Printing "Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!Hello world!" 500,000 times) (approximate average of 10 runs):
1.4 - 30833ms
1.6 - 8844ms
import java.awt.*;
import java.awt.event.*;
import java.awt.image.*;
import javax.swing.*;
public class DrawStringMicroBenchmark extends JFrame {
     private BufferedImage bi;
     private JTextField toPaintField;
     private SpinnerNumberModel iterModel;
     private JTextArea resultArea;
     public DrawStringMicroBenchmark() {
          bi = new BufferedImage(300,300, BufferedImage.TYPE_INT_RGB);
          JPanel cp = new JPanel(new BorderLayout());
          JPanel dataPanel = createDataPanel();
          cp.add(dataPanel, BorderLayout.NORTH);
          JPanel buttonPanel = new JPanel();
          JButton b = new JButton("Repaint");
          b.addActionListener(new ActionListener() {
               public void actionPerformed(ActionEvent e) {
                    runTest();
          buttonPanel.add(b);
          cp.add(buttonPanel, BorderLayout.SOUTH);
          setContentPane(cp);
          setTitle("Graphics2D#drawString() Micro Benchmark");
          setDefaultCloseOperation(EXIT_ON_CLOSE);
          pack();
     private JPanel createDataPanel() {
          JPanel dataPanel = new JPanel();
          dataPanel.setLayout(new BoxLayout(dataPanel, BoxLayout.Y_AXIS));
          dataPanel.setBorder(BorderFactory.createEmptyBorder(5,5,5,5));
          toPaintField = new JTextField("Hello world!", 30);
          dataPanel.add(createLabeledItem("String to paint: ", toPaintField));
          JSpinner iterSpinner = createIterSpinner();
          iterModel = (SpinnerNumberModel)iterSpinner.getModel();
          dataPanel.add(createLabeledItem("Iterations: ", iterSpinner));
          resultArea = new JTextArea(5, 30);
          resultArea.setEnabled(false);
          resultArea.setEditable(false);
          dataPanel.add(createLabeledItem("Result: ", new JScrollPane(resultArea)));
          dataPanel.add(Box.createVerticalGlue());
          return dataPanel;
     private JPanel createLabeledItem(String label, JComponent item) {
          JPanel temp = new JPanel(new BorderLayout());
          temp.add(new JLabel(label), BorderLayout.LINE_START);
          temp.add(item);
          return temp;
     private JSpinner createIterSpinner() {
          SpinnerModel model = new SpinnerNumberModel(50000, 1,Integer.MAX_VALUE, 1000);
          return new JSpinner(model);
     private void runTest() {
          String text = toPaintField.getText();
          int iter = ((Integer)iterModel.getValue()).intValue();
          Graphics2D g2d = bi.createGraphics();
          long start = System.currentTimeMillis();
          for (int i=0; i<iter; i++) {
               g2d.drawString(text, 30, 30);
          long time = System.currentTimeMillis() - start;
          resultArea.append(iter+ " iterations: " + time + " ms\n");
     public static void main(String[] args) {
          SwingUtilities.invokeLater(new Runnable() {
               public void run() {
                    new DrawStringMicroBenchmark().setVisible(true);
}

Similar Messages

  • Memory leak for services.exe

    Hi,
    I have been observing memory leak for "Services.exe" process and which causes server hung issue. I am having server 2008 R2, hosting SQL server 2008 R2.
    the handle count for services.exe rises to its limit quickly and the casues the server hung issue.

    Hi,
    I agree with Milos that you can install Process Monitor to find the root reason for this issue:
    http://technet.microsoft.com/en-au/sysinternals/bb896645.aspx
    In addition, it may caused by some corrupt event logs, please make sure you have applied the Maximum log size setting for event logs appropriately.
    Best regards,
    Susie

  • Will the memory leak for queue when used in producer and consumer mode in DAQ to transfer different sized array.

    In the data acquisition, I use one loop to poll data from hardware, another loop to receive the data from polling loop sent by queue.
    But everytime the size of the transferred data array may not be the same, so the system may assign different array size and recycle very frequently.
    Will it cost memory leak. Or will it slow down the performance, since the array size is not fixed, so every time need to create a new sized array.
    Any suggestion or better method. 
    Solved!
    Go to Solution.

    As i understand your description, your DAQ-loop acquires data with the setting '-1' for samples to read at the DAQmx read function. This results in the different array sizes.
    Passing those arrays directly to a queue is valid and it does not have significant drawback in performance (at least as far as i know) and it definetly does not leak memory.
    So the question is more or less:
    Is it valid that your consumer receives different array sizes for analysis? How does your consumer handle those arrays? 
    hope this helps,
    Norbert 
    CEO: What exactly is stopping us from doing this?
    Expert: Geometry
    Marketing Manager: Just ignore it.

  • IE Memory Leak for addCallback

    Everytime I register:
               ExternalInterface.addCallback("reload",reload);
    or any other ExternalInterface.addCallback
    I see memory leaks.  Even if its not called.  Does anyone know how to mitigate this?
    Also, I can't seem to get flash to release it's memory unless I close IE.  Is there another way?  I've already tried removeAll in extJS but it doesn't seem to work.  The element is removed but the memory is still being used. 
    thanks
    Pascal

    I believe that bug has not been fixed yet.  I don't know of any workarounds
    for the main app.  For child SWFs, proxy all calls through the main app.
    It also looks like you're trying to reload, but you might be better off
    resetting the app.

  • Memory leak in solaris 9

    Hi ,
    I have Oracle9i database running on Solaris 9. After every 6 days my solaris box went out of space although its a test box and there is no activity on the system. Why the hell it takes all the ram and swap space when there is no activity on the system except Oracle Instance is running with no user connection. What process are running in the background that takes all the memory and i have to restart this box every week. IS THERE ANT PATCH OF MEMORY LEAK FOR SOLARIS9?. I am not a solaris administrator and i have to fix this problem before moving my system to production. I would really appreciate your help.
    Thanks.

    Hi ,
    I have Oracle9i database running on Solaris 9. AfterI have had for some months been running oracle 9i (and 8i) under solaris 9. There have been no problems and the server has been stable.
    It sounds like you may have misconfigured the solaris kernel. It also sounds like your SGA is too large to fit in memory.
    So I guess the first step would be to check the SGA and then the /etc/system file.
    Here is what mine looks like for example:
    SQL> show sga
    Total System Global Area 219644872 bytes
    Fixed Size 730056 bytes
    Variable Size 167772160 bytes
    Database Buffers 50331648 bytes
    Redo Buffers 811008 bytes
    SQL>
    bash-2.05$ tail /etc/system
    set shmsys:shminfo_shmmax=4294967296
    set shmsys:shminfo_shmmin=1
    set shmsys:shminfo_shmmni=100
    set shmsys:shminfo_shmseg=10
    set semsys:seminfo_semmni=100
    set semsys:seminfo_semmsl=256
    set semsys:seminfo_semmns=1024
    set semsys:seminfo_semopm=100
    set semsys:seminfo_semvmx=32767
    bash-2.05$
    bash-2.05$ vmstat
    kthr memory page disk faults cpu
    r b w swap free re mf pi po fr de sr dd dd f0 s0 in sy cs us sy id
    0 0 0 2076240 1302024 0 1 1 0 0 0 0 0 4 0 0 411 92 135 0 1 99
    bash-2.05$
    You need to gather more system information to help you troubleshoot.

  • Memory leak issues persist in Safari 6.0.5 (it's about time that Apple actually fixed this)

    Safari has been notorious for its memory leaks for years, as I'm sure many of you know. I stopped using Safari as my main browser in 2010 or so, and I instead began to use Chrome. However, I recently had to use Safari to access some webpages, and I neglected to quit out of it. A few hours later, my computer slowed to a complete crawl. I was confused, because my computer never slows down to such a crawl, so I went into Activity Monitor to find the 'Safari Web Content' process using all of my available RAM, which was nearly 6 GB. Needless to say, Safari was force quit after that. I've heard that some plugins will cause this, but Flash was my only active plugin. Flash is, indeed, a heaping pile of crap that will readily eat resources as it sees fit- but this never happens to me in Chrome, and I use Flash all of the time n Chrome. This was after it had been sitting idle for quite some time, and I imagine that it would have used more RAM if it could.

    Using 6.0.5 here without any of those issues ...
    Regardless of whether Flash is being used, from your Safari menu bar click Help > Installed Plug-ins.
    Try troubleshooting extensions and third party plug-ins.
    From your Safari menu bar click Safari > Preferences then select the Extensions tab. Turn that off if there are any installed. Quit and relaunch Safari to test. If that helped, turn extensions back on then uninstall one a time to test.
    If it's not an extensions issue, try troubleshooting third party plug-ins.
    Back to Safari > Preferences. This time select the Security tab. Deselect:  Allow all other plug-ins. Quit and relaunch Safari to test.
    If that made a difference, instructions for troubleshooting plugins here.
    my computer slowed to a complete crawl.
    Checked to see exactly how much space is available ??
    Click your Apple menu icon top left in your screen. From the drop down menu click About This Mac > More Info > Storage
    Make sure there's at least 15% free disk space.
    Checked the startup disk lately?
    Launch Disk Utility located in HD > Applications > Utilities
    Select the startup disk on the left then select the First Aid tab.
    Click:  Verify Disk  (not Verify Disk Permissions)
    If the disk needs repairing, restart your Mac while holding down the Command + R keys. From there you can access the built in utilities in OS X Recovery to repair the startup disk.
    message edited by:  cs

  • Oracle JDBC Thin Driver Memory leak in scrollable result set

    Hi,
    I am using oracle 8.1.7 with oracle thin jdbc driver (classes12.zip) with jre 1.2.2. When I try to use the scrollable resultset and fetch records with the default fetch size, I run into memory leaks. When the records fetched are large(10000 records) over a period of access I get "outofmemory" error because of the leak. There is no use increasing the heap size as the leak is anyhow there.
    I tried using optimizeit and found there is a huge amout of memory leak for each execution of scrollable resultsets and this memory leak is propotional to the no of records fetched. This memory leak is not released even when i set the resultset,statement objects to null. Also when i use methods like scrollabelresultset.last() this memory leak increases.
    So is this a problem with the driver or i am doing some wrong.
    If some of you can help me with a solution to solve this it would be of help. If needed i can provide some statistics of these memory leaks using optimize it and share the code.
    Thanks
    Rajesh

    This thread is ancient and the original was about the 8.1.7 drivers. Please start a new thread. Be sure to include driver and database versions, stack traces, sample code and why you think there is a memory leak.
    Douglas

  • Finding Memory leaks in C using Visual Studio 2013

    I am using Visual Studio 2013, and taking a course in C programming and we started
    talking about memory bugs detaction, in particular memory leaks, and how to detect them using Valgrind on Linux.
    I want to know if there is a way to detect such memory leaks using VS 2013. I tried searching online but it just leads to lots of articles and blogs and msdn posts and blogs with lots of words like dump files, and analyzing them, etc which is weird
    because:
    1) It sounds so complex, convoluted and unintuitive it is actually hard to comprehend it.
    2) The main reason this is weird is due to the fact that VS is the most advanced IDE around and Microsoft spends so much money on in, yet from what I have read it seems that there is no simple way to use VS to detect memory leaks
    - certainly no way that's as simple as Valgrind where I only have to compile the program and run the command valgrind -leaks-check=yes ProgramName
    and it simply prints to me all location it thinks there is a memory leak and describes the error (like not freeing memory after allocating it with malloc hence having "dead" memory after the program finishes, or accessing memory that's out of
    the array bounds)                                                                                                                                                               
    So my question is how to use VS 2013 in order to achieve the same results and to find out First in high level if there are memory leaks in the program, and Second - to detect in a simple manner where those leaks are- preferably without involving dump files
    (not that I know how to use them anyway in VS).

    Hi MicrosoftLaw,
    Thanks for your post.
    Based on your issue, if you want to check if there are memory leaks in the C program from this VS2013. I suggest you could try to find Memory Leaks Using the CRT Library, for more information:
    https://msdn.microsoft.com/en-us/library/x98tx3cf.aspx?f=255&MSPPError=-2147217396
    In addition, I find a similar thread about this issue, please you refer the Dusty's suggestion to check this issue.
    http://stackoverflow.com/questions/45627/how-do-you-detect-avoid-memory-leaks-in-your-unmanaged-code
    I did some research about this issue, I found that the Visual Leak Detector extension tool is a free, robust, open-source memory leak detection system for Visual C++. So if possible, I suggest you could try to use the Visual Leak Detector extension
    tool to find the memory leak for Visual C/ C++ program.
    https://visualstudiogallery.msdn.microsoft.com/7c40a5d8-dd35-4019-a2af-cb1403f5939c
    However, if you have any issue about how to use this Visual Leak Detector extension tool to find the memory leak for C program. I suggest you could directly to write a review to this REVIEW tab in Visual Leak Detector site.
    Best Regards,
    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click
    HERE to participate the survey.

  • Memory leak when browsing through records

    Hello,
    I have a problem with any page containing the component related to each other on three or more levels. (1st level ADF Table, 2nd level ADF Table and 3rd level ADF Form)
    By navigating through the records of the first level, there is refreshment at other levels (using partial triggers), but suddenly there is loss of memory (memory leak) for components of type Select One Choice.
    Precisely, the problem appears when browsing another Show Detail Item in the same page.
    Screenshot showing the Data Control in my page: [http://www.infotun.net/usersimages/1/adf/structure.jpg]
    Capture screen representing the initial state where all is well: [http://www.infotun.net/usersimages/1/adf/initial.jpg]
    Capture screen representing the final state after memory loss: [http://www.infotun.net/usersimages/1/adf/final.jpg]
    I'm using JDeveloper Studio 11.1.1.2.0
    JDK: 1.6.0_14
    Operating System: Windows 7.
    Any help/advice is highly appreciated !
    Thanks
    Edited by: InfoTun on 10 juin 2012 16:22
    Edited by: InfoTun on 10 juin 2012 16:26

    Hi,
    the screenshot does not indicate a memory leak. Memory leaks show by the server memory consumption that leads to slow performance or stale applications. Your issue seems to be different from that and doesn't really explain in the screen shots. If you have a support contract then customer support is the recommendation I like to give
    Frank

  • Galaxy S6 Memory Leak - Multitasking

    I've begun to notice more and more that when multitasking, the phone's response time drags to the point of hardly usable, or the apps have to restart and multitasking is completely useless at that point. When this is happening and I check the App management portion in the settings, it shows the system is taking up anywhere from 1.5-2 GB of the RAM, apps are anywhere from 600-800 MB, and Free is whatever is leftover at that point. How is this even possible? I've seen reports of a memory leak issue within the operating system, and that's the only thing that seems to make sense when a phone with this much memory and processing power performs worse than a 2011 phone.  Are there any solutions that AT&T has to fix these? Otherwise this phone is almost useless to me

    if you have the 5.0.2 update installed that fixed the memory leak for my 920a
    If anything the most complaints I have seen is the ram managment is to aggresive on the s6 series.

  • T61 with memory leak on XP for driver battc.sys

    Hi
    I have an issue with XP where the battc.sys module that is part of Windows XP and responsible for the kernel side of monitoring the battery status. This module continually leaks memory until I have no more kernel paged resources left and programs start to fail on my laptop.
    I raised a support case for this with Microsoft and after some investigation and upgrading to the latest T61 power drivers that were released a few days ago on the Lenovo site, MS support told me it is a fault of the T61 and that I would need to disable Microsoft APCI support to stop this memory leak from occuring and to take the issue up with Lenovo.
    I have used the verifier tool to confirm that it is the Windows XP SP3 battc.sys memory module leaking.
    I am running the latest T61 drivers and fully patch with MS drivers on SP3.
    As MS have told me it is the fault of the T61 I am posting this issue here.
    Thanks
    Stephen

    It is memory available to the kernelwhich itself does not show under a process in task manager as far as I am aware (unles it is taken account as part of the system process).
    The best way to measure the available kernel memory space available is by using sysinternals procexp.
    You need to download procexp and also install the windows debugging tools from Microsoft. Then in procexp set the "Options > Configure Symbols : Debughlp.dll path" to the new debughlp.dll installed with your debu tools and set the symbols path to srv*c:\Symbols*http://msdl.microsoft.com/download/symbols
    Then you can choose in procexp "View > System Information" and see the used and total paged and non-paged kernel memory space.
    poolmon helps monitor all the symbols that are taking up this memory and verifier lets you drill down to the exact module and the changes in memory for a module that is occuring.
    Here are two really good links on it
    http://blogs.msdn.com/ntdebugging/archive/2006/12/18/Understanding-Pool-Consumption-and-Event-ID_3A0...
    http://blogs.msdn.com/ntdebugging/archive/2008/05/08/tracking-down-mmst-paged-pool-usage.aspx
    In my poolmon i notice that Mmst and battc are taking alot of memory after my computer has been running for some time. Mmst being high is normal but battc should not continually be growing as it is which is why I raised the case to MS but they want verification it is not a Lenovo issue.

  • 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.

  • How to configure license file for Memory Leak tool and WL Server 9.2?

    (I posted to general JRockit forum before realizing existence of this forum which is probably more applicable.)
    Here's our problem:
    Running latest version of WL 9.2 MP3 and JRockit Mission Control 3.0.1
    Able to run Mission Control, and connect to the WL Server and to run View Console with no problems.
    I can't get Memory Leak tool to run because it complains about needing a license file.
    First I tried with off the shelf WL 9.2 MP3.
    Get error:
    A license for Memory Leak Detector could not be found on the JRockit at (1.5) weblogic.Server (192).
    Error: Can not find component Memory Leak Detector for JRockit * in the license file. Please check http://www.jrockit.com/license for license updates.
    So I downloaded license file from JRockit download site - wls92.zip. It contains several files, but no clear instructions on what to do with these files. I copied one of these files "LIC-WLSP92.txt" to my JRockit home as C:\bea\JROCKI~1\jre\license.bea
    Tried again. Restarted WL server. Restarted JRockit Mission Control.
    Get error: A license for Memory Leak Detector could not be found on the JRockit at (1.5) weblogic.Server (3052).
    The license file does not exist at: C:\bea\JROCKI~1\jre\license.bea
    Any advise on how to install license or who to contact for help?

    Installed Mission Control 3.0.3.
    Got following message when I attempted to run Memory Leak:
    A license for Memory Leak Detector could not be found on the JRockit at (1.5) weblogic.Server (192).
    Error: Can not find component Memory Leak Detector for JRockit * in the license file.
    Please check http://www.jrockit.com/license for license updates.
    I believe that we're using the latest downloads of WebLogic 9.2.x and JRockit.
    WebLogic is running using 9.2.3 and JRockit build R27.4.0-90_CR358515-94243-1.5.0_12-20080118-1154-windows-ia2
    Contents of C:\bea\jrockit_150_12\jre\license.bea:
    <?xml version="1.0" encoding="ISO-8859-1"?>
    <bea-licenses>
    <license-group format="1.0" product="JRockit" release="*">
    </license-group>
    </bea-licenses>
    Could WebLogic be misconfigured?
    Any diagnostics to help figure out the licensing?
    Any other ideas?

  • Memory Leak Issue for Adobe Access iOS API

    Hi,
    We are trying to develop an iOS app (with ARC enabled) using Adobe Acces API 4.0 and we have identified that the function [drmManager createDRMSession] has memory leak.
    DRMSESSION = [drmManager createDRMSession:METADATA playlist:PLAYLIST error:nil complete:^() {}];
    We are using:
    DRMSESSION  -> weak
    METADATA    ->strong  (as need to share within object)
    PLAYLIST       ->strong  (as need to share within object)
    After calling this function, the object is unable to dealloc and most of the leaking object related to networking (such as CFNetwork...)
    Is this a known issue for the Adobe Access iOS API or we are missing some key steps.
    Any suggestions is appreciated. Thanks in advance.

    ans0600, sorry about that, I read Hiroshi's forward too quickly.  I've done a little digging and have come up with two work-arounds:
    Create a file with ARC disabled to translate the returned object to be an autorelease
    declare the returned DRMSession as __unsafe_unretained and use CFRelease, as noted on stackexchange
    In the future we may change this method to return an autoreleased object to avoid this issue.  Let us know if you have any further questions!

  • Memory Leak in 8.1.6.0.1 JDBC/OCI for Solaris

    Hello,
    there is a memory leak in the 8.1.6.0.1 JDBC-OCI driver for solaris.
    The leak causes your jvm to eat up all memory
    if you reuse callable statements
    (calling one statement multiple times with
    different values).
    The thin driver has no such problem. Is
    there any fix available ?

    Ok. The code spans multiple classes and
    most of it comes from a customized version
    of the Enhydra Java Application server.
    I have a class called "StandardDBConnection"
    which caches CallableStatements and is a
    wrapperclass for java.sql.DBConnection. The
    interesting method here is "prepareCall":
    * Get a callable statement given an SQL string. If the statement is
    * cached, return that statement, otherwise prepare and save in the
    * cache.
    * @param sql The SQL statement to be called.
    * @return a new CallableStatement object containing the
    * pre-compiled SQL statement.
    * @exception java.sql.SQLException If a database access error occurs
    * statement.
    public synchronized CallableStatement prepareCall(String sql)
    throws SQLException {
    PreparedStatement preparedStmt;
    logDebug ("Prepare call: " + sql);
    validate();
    preparedStmt = (PreparedStatement)preparedStmtCache.get(sql);
    // Check if the object returned by the cache really is a
    // callable statement. if it is not, someone did call first
    // prepareStatement() and now prepareCall() with the same
    // sql. Silently replace the existing cache entry by a
    // callable statement in this case.
    if (preparedStmt instanceof CallableStatement) {
    preparedStmt.clearParameters();
    else {
    // Need to close the old PreparedStatement in case we have to
    // replace it with a CallableStatement
    if (preparedStmt != null) {
    preparedStmt.close();
    else if (preparedStmtCache.size() >= maxPreparedStmts) {
    String key = (String)preparedStmtCache.keys().nextElement();
    ((PreparedStatement) preparedStmtCache.remove(key)).close();
    preparedStmt = connection.prepareCall(sql);
    preparedStmtCache.put(sql, preparedStmt);
    return (CallableStatement)preparedStmt;
    The statements get closed when I close the
    connection:
    boolean closeStmts = true;
    // Close the prepared statements.
    Enumeration e = preparedStmtCache.keys();
    while (e.hasMoreElements() && closeStmts) {
    String key = (String)e.nextElement();
    try {
    ((PreparedStatement)
    preparedStmtCache.remove(key)).close();
    } catch (SQLException except) {
    // Ignore errors, we maybe handling one.
    closeStmts = false;
    log.write(Logger.NOTICE,
    "DBConnection[" + id + "]: " + url +
    "\nUnable to close statements. Continuing....\n");
    In my classes using database queries I just
    use the prepareCall method of DBConnection
    and do not have to care about anything.
    Works perfectly with the thin driver, but
    as soon as I switch to oci... :-|
    <BLOCKQUOTE><font size="1" face="Verdana, Arial">quote:</font><HR>Originally posted by JDBC Dev Team:
    Soda, Rupper,
    Do you mind posting some code that shows us what your code was doing when you notice this leak?
    Thanks.<HR></BLOCKQUOTE>
    null

Maybe you are looking for

  • Multiple repeating SubForms binding to the same data node

    Having multiple repeating SubForms binding to the same data node : In our documents, many times we need to display information from same table in multiple locations. For example, if document displays information of Insureds on one page and informatio

  • Transfer video then delete?

    My current laptop (PC) doesn't have enough memory to hold the library of video I would like it to. Is it possible to purchase items on one computer, transfer them to another authorized computer, delete the original purchase (to free up space on my la

  • How to use Siri with an IPad 2 iOS update to 7

    Hello all, i would like to Know  How to use Siri with my iPad 2.  My iPad turn on iOS 7.0.2 and i don t view this possibiliy .  Thank you all

  • Attributes in Organisation Model.

    Hi all, I have a general question regarding the Attributes in Organisation Model. For example: when we Set the attribute of a country to GB or US. It inpact it would bring...? Regards,

  • BI Request stuck in Service API

    Hi, I am trying to load some data in BW. And the BW data load request seems to get stuck in Servie API. There's no job created for this request in R/3 althought a job is running in BW. In the request the Processing Step is "Service API" and doesn't p