Uncontrolled Memory usage in webcenter application.

I have a webcenter application which I use as Consumer Application. This application contains 30 Portlets registered using portlet producers.
All these portlets are again webcenter applications portletized using the Portlet Faces Bridge.
I deploy this consumer application on one of the OC4J containers in application server.
Also, the 30 producers are deployed in another OC4J Container in the same application server.
When I start accessing my consumer application and the page containing any portlet, the heap size of that container starts increasing till it reaches maximum level and then finally hangs up. Also, this heap size does not come down and I am not able to fulfill any further requests.
The container and application logs suggest java.lang.OutOfMemory Error . Heap Space.
Also, the heap size of producer containers is under control. I am not able to understand how to control / release this heap memory.
When I run a minimized version of this consumer application ( having 5 - 10 portlet producers registered) It works pretty fine.
So I think when the number of portlet producer registrations increase, there is this memory leak.
Is there a limit to the number of portlet producers that can be registered in a webcenter consumer application? How can I find out where exactly is the memory leak? How do I bring down the heap size once processing is finished?

Hi vsharma2,
Thanks a lot for your reply.
we have tried all the things mentioned by you. We have also increased the physical memory to the extent we could.
But my main concern is that the memory does not get released. We cannot increase memory to very high levels. It has to stop somewhere.
If we could get a solution whereby we understand how to release the memory consumed by the portlet producers once they have been used, it could solve the problem. Unfortunately, we haven't got any solution in this direction. Also, we have done code optimization, closed everything (whatever we can) in finally block and increased the container Heap size also.
Hope we get something to release the memory consumed by portlets or portlet producers.
Anyway, thanks a lot for your directions.
Regards,
Kunal

Similar Messages

  • How to capture memory usage for web application

    In OATS openscripts, how to capture memory usage for web application? Does it have the exisitng java method that we can call to get the memory data (e.g. peak bytes, private bytes) consumed by web application?

    JProbe

  • CPU/memory usage of AIR application under Mac 10.4.10

    As my AIR application uses a lot of CPU/memory under Mac
    (seems better in Windows), I decide to do some basic testing. I
    create several applications with different level of complexities.
    Below is a table of CPU/memory usage when the application is simply
    sitting there. A brief description of the application can be found
    in the end of each line.
    Here are some results:
    [1] Even for an empty application, CPU usage is not zero
    (most non-AIR application has 0 CPU usage when doing nothing). Also
    the memory usage is huge, comparable to Finder on my computer.
    [2] Empty application has 7 threads running.
    [3] Indetermined progress bar costs a lot of CPU; and I guess
    any other animation costs a lot of CPU too. But if they are
    invisible they are fine.
    [4] running timer costs CPU.
    PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE
    VSIZE application
    10093 adl 1.8% 0:01.85 7 100 292 15.0M 13.8M+ 22.8M 444M
    empty
    10094 adl 1.9% 0:01.55 7 100 299 15.2M 14.0M+ 23.1M 444M
    label
    10097 adl 1.9% 0:01.48 7 100 302 15.3M 13.4M 23.7M 445M
    progress bar
    10095 adl 5.7% 0:02.40 7 100 302 15.4M- 13.2M 23.5M 445M
    progress bar (indetermined)
    10125 adl 15.9% 0:03.66 7 100 304 15.7M- 13.4M 23.9M 445M 5
    progress bar (indetermined)
    10126 adl 29.7% 0:10.39 7 100 325 16.7M+ 13.4M+ 24.9M+ 445M
    10 progress bar (indetermined)
    10128 adl 1.9% 0:01.34 7 100 324 16.1M 13.7M 24.3M 445M 10
    progress bar (indetermined), visible=false
    10136 adl 1.8% 0:00.76 7 100 323 16.5M+ 13.9M+ 24.7M- 450M
    Empty datagrid
    10147 adl 1.9% 0:01.60 7 101 328 16.1M 13.8M+ 24.5M- 447M
    TabNavigator with two empty VBox children
    10138 adl 1.8% 0:01.59 7 100 372 19.4M 13.9M 27.7M 453M
    datagrid with 10000 simple rows
    10131 adl 3.1% 0:02.38 7 110 348 25.7M 19.3M 34.8M 458M 10
    Empty native windows
    10143 adl 1.9% 0:00.99 7 100 296 15.1M 13.9M+ 23.2M- 444M
    Timer, delay = 100ms, calling an empty function
    10145 adl 4.1% 0:02.35 7 100 298 15.0M 14.0M+ 23.2M- 444M
    Timer, delay = 100ms, calling function update label position
    As to my own application, it's much bigger than these simple
    ones. The CPU usually stablizes to 20% and VSIZE is about 1G. There
    is no timer running. When I leave the application open for a few
    hours, the application will eventually freeze and I have to kill
    it.
    I am wondering if there are any articles or documents
    explaining AIR's CPU/memory usage. And also if AIR is planning to
    improve the performance in the next release.

    James, thank you for the very fast answer! I did various tests on the weekend on my computer and computer of my friend.
    And I can say, that Debug flag doesn't affect memory consumption.   They still eat memory. My steps to reproduce are as follows:
    (Windows 7 32 bit)
    Photoshop CS5:
    1) set HKEY_CURRENT_USER\Software\Adobe\CSXS2Preferences\PlayerDebugMode to 0
    2*) check HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\CSXS2Preferences (just in case)
    3) Compile HelloPhotoshop example to ZXP and install via  Extension manager
    4) restart computer
    5) Run Photoshop CS5 - Memory consumption: 100 096 KB
    6) Open HelloPhotoshop and close it 10 times
    7) Memory consumption: 155 840 - 5,574 MB per one close/open
    Maybe a garbage collector is expected to run and free this memory, but it never happened in my case. The memory pool was increasing to 1 GB when I was working with one of my panels - with no documents open in Photoshop
    In InDesign I tried the same thing with HelloInDesign ( I had to close the panel completely and then open with Window | Extensions | HelloInDesign)
    Memory consumption on start: 118 516
    Memory consumption after 10 open/close cycles: 197 516
    It's 7,9 MB per one close/open
    It's the simpliest panel test. When I'm using AIR libraries the memory usage is increasing a lot faster.

  • Extensive (very very very extensive) memory usage of host application with CS extension

    Hi!
    I tried this only under Photoshop CS5 and InDesign CS5 under Windows 7.
    When you open and close CS extension panel, the memory taken by Photoshop (InDesign) increases by 6-30MB!
    In case of the simple HelloPhotoshop (HelloInDesign) panel from the examples, compiled in release mode, when you open it and close, - it's about 6-10MB each time you do it. And in case of a more complex panel, which uses AIR, etc. it's about 30MB per one panel close/open.
    When I use some panels in 5-10 minutes Photoshop (InDesign) increases its memory pool from 600MB up to 1,2 GB. And more. And this memory is never freed, only until Photoshop (InDesign) shutdown.
    I tried freeing all my arrays, killing display objects, etc. - nothing helped. Even a simple HelloPhotoshop (HelloInDesign) that does nothing eats memory.
    By the way, InDesign eats memory a lot faster .

    James, thank you for the very fast answer! I did various tests on the weekend on my computer and computer of my friend.
    And I can say, that Debug flag doesn't affect memory consumption.   They still eat memory. My steps to reproduce are as follows:
    (Windows 7 32 bit)
    Photoshop CS5:
    1) set HKEY_CURRENT_USER\Software\Adobe\CSXS2Preferences\PlayerDebugMode to 0
    2*) check HKEY_LOCAL_MACHINE\SOFTWARE\Adobe\CSXS2Preferences (just in case)
    3) Compile HelloPhotoshop example to ZXP and install via  Extension manager
    4) restart computer
    5) Run Photoshop CS5 - Memory consumption: 100 096 KB
    6) Open HelloPhotoshop and close it 10 times
    7) Memory consumption: 155 840 - 5,574 MB per one close/open
    Maybe a garbage collector is expected to run and free this memory, but it never happened in my case. The memory pool was increasing to 1 GB when I was working with one of my panels - with no documents open in Photoshop
    In InDesign I tried the same thing with HelloInDesign ( I had to close the panel completely and then open with Window | Extensions | HelloInDesign)
    Memory consumption on start: 118 516
    Memory consumption after 10 open/close cycles: 197 516
    It's 7,9 MB per one close/open
    It's the simpliest panel test. When I'm using AIR libraries the memory usage is increasing a lot faster.

  • How to minimize memory usage with VM settings

    Using JDK 1.4.2, I am trying to minimize the memory usage of my application.
    Our GUI application consumes about ~20MB of heap space during normal operation, but it can easily grow to 50MB in some rare cases (Special feature accessed by user).
    We have to be able to run multiple instances (separate process/VMs) of this application on low end Windows PCs.
    The applications don't usually run for very long (less than 8 hours).
    Here is my problem.
    If I set the -Xms=20M -Xmx=64M, it works fine, but the GC is not very aggressive and soon, the application starts using a lot of memory, even if it is not really needed. And it never returns the memory to Windows OS.
    So each VM take more memory than really needed, which causes significant swapping on these low end PC (little RAM available).
    If I reduce the -Xmx flag, than I run out of memory in the rare cases where I need the full memory.
    Ideally, I would like to configure the GC to be more aggressive, i.e. the GC should collect instead of getting additional memory from the OS when possible.
    I read a few papers on Sun's web site about HotSpot tunning, but most of them are geared for large servers.
    Thanks!
    Francois

    And you are using the task manager to determine how "much" memory is being used correct?
    I suggest that you search out and read the numerous threads on this site that discuss that subject.

  • System Settings - Memory usage - Application

    In Memory Usage - Application, under System Settings, my slider is set to 100% and gives 2560 MB.
    I was wondering where this figure of 2560MB comes from, is that the max that FCE can use/access? I have 10Gb Ram on the system in total, why is FCE only using 2560?
    Is this normal, or indicating a problem on the system somewhere?
    Thanks
    Neil

    Thanks
    That has set my mind at rest. I have not broken it or done something wrong then.
    I am just working my way through a basic FCE 4 tutorial book.
    More dumb questions to follow
    NP

  • Calcualte Oracle applications memory usage

    Is there a way or does anyone have a script for oracle applications memory usage of a period of 30 days??

    Hi
    By implementing the statspack you can get most of the statistics information including memory usage of apps instance with time intervals. Since there is no GUI performance analysis is complicated with statspack. If you are on 10g a new feature called AWR(automatic workload repository) which gives you statistics and metrics with html format report.
    There are some tools to monitor the Oracle applications services like cpu , memory consumption... I prefer to go with your own customization scripts to monitor the instance.
    You can get plenty of scripts in the net.
    http://www.orafaq.com/scripts/
    I have little experience with bmcsoftware which monitors oracle Applicatons. But I am not sure whether it gives statistics for the timeperiod. See the below whitepaper of bmc.
    http://documents.bmc.com/products/documents/66/54/56654/56654.pdf
    Regards
    Srinath

  • Application Server Control 10g : Memory usage wrong

    Hi,
    We have install an OAS 10g on Windows Server 2003 with 8Gb RAM. But on the Application server Control, only 2 Gb are display in memory usage (Application server 372 Mb+Free 1675 Mo).
    How configure Application Server to see all memory available ?
    Thanks

    32bit Windows have 4GB address space, which is split 2Gb system and 2Gb user. So user processes have 2Gb virtual address space (even if hw has more RAM).
    Perhaps "App Server Control" mem stats system is limited by this concept. And maybe the app server is threaded?
    Is it 32bit or 64bit hardware and OS?

  • Problem with Firefox and very heavy memory usage

    For several releases now, Firefox has been particularly heavy on memory usage. With its most recent version, with a single browser instance and only one tab, Firefox consumes more memory that any other application running on my Windows PC. The memory footprint grows significantly as I open additional tabs, getting to almost 1GB when there are 7 or 8 tabs open. This is as true with no extensions or pluggins, and with the usual set, (firebug, fire cookie, fireshot, XMarks). Right now, with 2 tabs, the memory is at 217,128K and climbing, CPU is between 0.2 and 1.5%.
    I have read dozens of threads providing "helpful" suggestions, and tried any that seem reasonable. But like most others who experience Firebug's memory problems, none address the issue.
    Firefox is an excellent tool for web developers, and I rely on it heavily, but have now resorted to using Chrome as the default and only open Firefox when I must, in order to test or debug a page.
    Is there no hope of resolving this problem? So far, from responses to other similar threads, the response has been to deny any responsibility and blame extensions and/or pluggins. This is not helpful and not accurate. Will Firefox accept ownership for this problem and try to address it properly, or must we continue to suffer for your failings?

    55%, it's still 1.6Gb....there shouldn't be a problem scanning something that it says will take up 300Mb, then actually only takes up 70Mb.
    And not wrong, it obviously isn't releasing the memory when other applications need it because it doesn't, I have to close PS before it will release it. Yes, it probably is supposed to release it, but it isn't.
    Thank you for your answer (even if it did appear to me to be a bit rude/shouty, perhaps something more polite than "Wrong!" next time) but I'm sitting at my computer, and I can see what is using how much memory and when, you can't.

  • Problem with scanning and memory usage

    I'm running PS CS3 on Vista Home Premium, 1.86Ghz Intel core 2 processor, and 4GB RAM.
    I realise Vista only sees 3.3GB of this RAM, and I know Vista uses about 1GB all the time.
    Question:
    While running PS, and only PS, with no files open, I have 2GB of RAM, why will PS not let me scan a file that it says will take up 300Mb?
    200Mb is about the limit that it will let me scan, but even then, the actual end product ends up being less than 100Mb. (around 70mb in most cases)I'm using a Dell AIO A920, latest drivers etc, and PS is set to use all avaliable RAM.
    Not only will it not let me scan, once a file I've opened has used up "x" amount of RAM, even if I then close that file, "x" amount of RAM will STILL be unavaliable. This means if I scan something, I have to save it, close PS, then open it again before I can scan anything else.
    Surely this isn't normal. Or am I being stupid and missing something obvious?
    I've also monitored the memory usage during scanning using task manager and various other things, it hardly goes up at all, then shoots up to 70-80% once the 70ishMb file is loaded. Something is up because if that were true, I'd actually only have 1Gb of RAM, and running Vista would be nearly impossible.
    It's not a Vista thing either as I had this problem when I had XP. In fact it was worse then, I could hardly scan anything, had to be very low resolution.
    Thanks in advance for any help

    55%, it's still 1.6Gb....there shouldn't be a problem scanning something that it says will take up 300Mb, then actually only takes up 70Mb.
    And not wrong, it obviously isn't releasing the memory when other applications need it because it doesn't, I have to close PS before it will release it. Yes, it probably is supposed to release it, but it isn't.
    Thank you for your answer (even if it did appear to me to be a bit rude/shouty, perhaps something more polite than "Wrong!" next time) but I'm sitting at my computer, and I can see what is using how much memory and when, you can't.

  • Problem with JTree and memory usage

    I have problem with the JTree when memory usage is over the phisical memory( I have 512MB).
    I use JTree to display very large data about structure organization of big company. It is working fine until memory usage is over the phisical memory - then some of nodes are not visible.
    I hope somebody has an idea about this problem.

    55%, it's still 1.6Gb....there shouldn't be a problem scanning something that it says will take up 300Mb, then actually only takes up 70Mb.
    And not wrong, it obviously isn't releasing the memory when other applications need it because it doesn't, I have to close PS before it will release it. Yes, it probably is supposed to release it, but it isn't.
    Thank you for your answer (even if it did appear to me to be a bit rude/shouty, perhaps something more polite than "Wrong!" next time) but I'm sitting at my computer, and I can see what is using how much memory and when, you can't.

  • Memory usage of excel stays high after Macro is executed and excel crashes after trying to close it

    Hi,
    I'm trying to resolve an issue with an excel based tool. The macros retrieve data from an Oracle database and do calculations with the data. They also open and write into files in the same directory. The macros all run and finish the calculations. I can
    continue to use and modify the sheet. I can also close the workbook, however excel memory usage I see in the windows Task manager stays elevated.If I  close Excel it says: Excel stopped working and then it tries to recover information...
    I assume something in the macro did not finish properly and memory was not released. I would like to check what is still open (connection, stream or any other object) when I close the workbook I would like to have a list of all still used memory. Is there
    a possibility to do so.
    Here the code I'm using, its reduced to functions which open something. Functions   
    get_v_tools() and get_change_tools() are same as get_client_positions().
    Public conODBC As New ADODB.Connection
    Public myPath As String
    Sub get_positions()
    Dim Src As range, dst As range
    Dim lastRow As Integer
    Dim myPath As String
    lastRow = Sheets("SQL_DATA").Cells(Sheets("SQL_DATA").rows.Count, "A").End(xlUp).Row
    Sheets("SQL_DATA").range("A2:AD" & lastRow + 1).ClearContents
    Sheets("SQL_DATA").range("AG2:BE" & lastRow + 2).ClearContents
    Sheets("SQL_DATA").range("AE3:AF" & lastRow + 2).ClearContents
    k = Sheets("ToolsList").Cells(Sheets("ToolsList").rows.Count, "A").End(xlUp).Row + 1
    Sheets("ToolsList").range("A2:M" & k).ClearContents
    'open connection
    Call open_connection
    lastRow = Sheets("SQL_DATA").Cells(Sheets("SQL_DATA").rows.Count, "A").End(xlUp).Row
    If lastRow < 2 Then GoTo ErrorHandling
    'copy bs price check multiplications
    Set Src = Sheets("SQL_DATA").range("AE2:AF2")
    Set dst = Worksheets("SQL_DATA").range("AE2").Resize(lastRow - 1, Src.columns.Count)
    dst.Formula = Src.Formula
    On Error GoTo ErrorHandling
    'new prices are calculated
    newPrice_calculate (lastRow)
    Calculate
    myPath = ThisWorkbook.Path
    'Refresh pivot table in Position Manager
    Sheets("Position Manager").PivotTables("PivotTable3").ChangePivotCache ActiveWorkbook. _
    PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
    myPath & "\[Position_Manager_v1.0.xlsm]SQL_DATA!R1C2:R" & lastRow & "C31" _
    , Version:=xlPivotTableVersion14)
    ErrorHandling:
    Set Src = Nothing
    Set dst = Nothing
    If conODBC.State <> 0 Then
    conODBC.Close
    End If
    End Sub
    Sub open_connection()
    Dim sql_data, sql_data_change, sql_data_v As Variant
    Dim wdth, TotalColumns, startRow As Integer
    Dim rst As New ADODB.Recordset
    Errorcode = 0
    On Error GoTo ErrorHandling
    Errorcode = 1
    With conODBC
    .Provider = "OraOLEDB.Oracle.1"
    .ConnectionString = "Password=" & pswrd & "; Persist Security Info=True;User ID= " & UserName & "; Data Source=" & DataSource
    .CursorLocation = adUseClient
    .Open
    .CommandTimeout = 300
    End With
    startRow = Sheets("SQL_DATA").Cells(Sheets("SQL_DATA").rows.Count, "A").End(xlUp).Row + 1
    sql_data = get_client_positions(conODBC, rst)
    wdth = UBound(sql_data, 1)
    Sheets("SQL_DATA").range("A" & startRow & ":AA" & wdth + startRow - 1).Value = sql_data
    'Run change tools instruments
    startRow = Sheets("ToolsList").Cells(Sheets("ToolsList").rows.Count, "A").End(xlUp).Row + 1
    sql_data_change = get_change_tools(conODBC, rst)
    wdth = UBound(sql_data_change, 1)
    Sheets("ToolsList").range("A" & startRow & ":M" & wdth + startRow - 1).Value _
    = sql_data_change
    'open SQL for V tools instruments
    startRow = Sheets("ToolsList").Cells(Sheets("ToolsList").rows.Count, "A").End(xlUp).Row + 1
    sql_data_v = get_v_tools(conODBC, rst)
    wdth = UBound(sql_data_v, 1)
    Sheets("ToolsList").range("A" & startRow & ":L" & startRow + wdth - 1).Value = sql_data_v
    conODBC.Close
    ErrorHandling:
    If rst.State <> 0 Then
    rst.Close
    End If
    Set rst = Nothing
    End Sub
    Private Function get_client_positions(conODBC As ADODB.Connection, rst_posi As ADODB.Recordset) As Variant
    Dim sql_data As Variant
    Dim objCommand As ADODB.Command
    Dim sql As String
    Dim records, TotalColumns As Integer
    On Error GoTo ErrorHandling
    Set objCommand = New ADODB.Command
    sql = read_sql()
    With objCommand
    .ActiveConnection = conODBC 'connection for the commands
    .CommandType = adCmdText
    .CommandText = sql 'Sql statement from the function
    .Prepared = True
    .CommandTimeout = 600
    End With
    Set rst_posi = objCommand.Execute
    TotalColumns = rst_posi.Fields.Count
    records = rst_posi.RecordCount
    ReDim sql_data(1 To records, 1 To TotalColumns)
    If TotalColumns = 0 Or records = 0 Then GoTo ErrorHandling
    If TotalColumns <> 27 Then GoTo ErrorHandling
    If rst_posi.EOF Then GoTo ErrorHandling
    l = 1
    Do While Not rst_posi.EOF
    For i = 0 To TotalColumns - 1
    sql_data(l, i + 1) = rst_posi.Fields(i)
    Next i
    l = l + 1
    rst_posi.MoveNext
    Loop
    ErrorHandling:
    rst_posi.Close
    Set rst_posi = Nothing
    Set objCommand = Nothing
    get_client_positions = sql_data
    End Function
    Private Function read_sql() As String
    Dim sqlFile As String, sqlQuery, Line As String
    Dim query_dt As String, client As String, account As String
    Dim GRP_ID, GRP_SPLIT_ID As String
    Dim fso, stream As Object
    Set fso = CreateObject("Scripting.FileSystemObject")
    client = Worksheets("Cover").range("C9").Value
    query_dt = Sheets("Cover").range("C7").Value
    GRP_ID = Sheets("Cover").range("C3").Value
    GRP_SPLIT_ID = Sheets("Cover").range("C5").Value
    account = Sheets("Cover").range("C11").Value
    sqlFile = Sheets("Cover").range("C15").Value
    Open sqlFile For Input As #1
    Do Until EOF(1)
    Line Input #1, Line
    sqlQuery = sqlQuery & vbCrLf & Line
    Loop
    Close
    ' Replace placeholders in the SQL
    sqlQuery = Replace(sqlQuery, "myClent", client)
    sqlQuery = Replace(sqlQuery, "01/01/9999", query_dt)
    sqlQuery = Replace(sqlQuery, "54747743", GRP_ID)
    If GRP_SPLIT_ID <> "" Then
    sqlQuery = Replace(sqlQuery, "7754843", GRP_SPLIT_ID)
    Else
    sqlQuery = Replace(sqlQuery, "AND POS.GRP_SPLIT_ID = 7754843", "")
    End If
    If account = "ZZ" Then
    sqlQuery = Replace(sqlQuery, "AND AC.ACCNT_NAME = 'ZZ'", "")
    Else
    sqlQuery = Replace(sqlQuery, "ZZ", account)
    End If
    ' Create a TextStream to check SQL Query
    sql = sqlQuery
    myPath = ThisWorkbook.Path
    Set stream = fso.CreateTextFile(myPath & "\SQL\LastQuery.txt", True)
    stream.Write sql
    stream.Close
    Set fso = Nothing
    Set stream = Nothing
    read_sql = sqlQuery
    End Function

    Thanks Starain,
    that's what I did the last days and found that the problem is in the
    newPrice_calculate (lastRow)
    function. This function retrieves data (sets it as arrays) which was correctly pasted into the sheet, loops through all rows and does math/calendar calculations with cell values using an Add-In("Quantlib")
    Public errorMessage as String
    Sub newPrice_calculate(lastRow)
    Dim Type() As Variant
    Dim Id() As Variant
    Dim Price() As Variant
    Dim daysTo() As Variant
    Dim fx() As Variant
    Dim interest() As Variant
    Dim ObjCalend as Variant
    Dim newPrice as Variant
    On Error GoTo Catch
    interest = Sheets("SQL_DATA").range("V2:V" & lastRow).Value
    Type = Sheets("SQL_DATA").range("L2:L" & lastRow).Value Id = Sheets("SQL_DATA").range("M2:M" & lastRow).Value Price = Sheets("SQL_DATA").range("T2:T" & lastRow).Value
    daysTo = Sheets("SQL_DATA").range("K2:K" & lastRow).Value
    fx = Sheets("SQL_DATA").range("U2:U" & lastRow).Value
    qlError = 1
    For i = 2 To lastRow
    If (i, 1) = "LG" Then
    'set something - nothing spectacular like
    interest(i, 1) = 0
    daysTo(i , 1) = 0
    Else
    adjTime = Sqr(daysTo(i, 1) / 365)
    ObjCalend(i,1) =Application.Run("qlCalendarHolidaysList", _
    "CalObj", ... , .... other input parameters)
    If IsError(ObjCalend(i,1)) Then GoTo Catch
    'other calendar calcs
    newPrice(i,1) = Application.Run( 'quantLib calcs)
    End If
    Catch:
    Select Case qlError
    Case 1
    errorMessage = errorMessage & " QuantLibXL Cal Error at: " & i & " " & vbNewLine & Err.Description
    ObjCalend(i,1) (i, 1) = "N/A"
    End Select
    Next i
    Sheets("SQL_DATA").range("AB2:AB" & lastRow).Value = newPrice
    'Sheets("SQL_DATA").range("AA2:AA" & lastRow).Value = daysTo
    ' erase and set to nothing all arrays and objects
    Erase Type
    Erase id
    Erase Price
    Set newPrice = Nothing
    Is there a possibility to clean everything in:
    Private Sub Workbook_BeforeClose(Cancel As Boolean)
    End Sub
    Thanks in advance
    Mark

  • TOP - Pageouts and memory usage.

    Looks like I have plenty of memory for what I am doing. But What do the cumulative numbers around pagein's mean?
    Processes: 80 total, 7 running, 3 stuck, 70 sleeping... 523 threads 15:20:14
    Load Avg: 1.99, 1.53, 1.37 CPU usage: 10.33% user, 9.00% sys, 80.67% idle
    SharedLibs: num = 5, resident = 13M code, 0 data, 1468K linkedit.
    MemRegions: num = 32848, resident = 2116M + 18M private, 877M shared.
    PhysMem: 1853M wired, 2116M active, 3466M inactive, 7439M used, 753M free.
    VM: 19G + 284M 332461(0) pageins, 47(0) pageouts
    PID COMMAND %CPU TIME #TH #PRTS #MREGS RPRVT RSHRD RSIZE VSIZE
    12256 top 11.1% 0:14.05 1 18 40 684K 820K 1392K 18M
    12238 bash 0.0% 0:00.01 1 14 19 276K 184K 916K 18M
    12237 login 0.0% 0:00.02 1 17 136 908K 8724K 3164K 32M
    12236 Terminal 1.7% 0:01.45 3 99 433 5264K+ 49M+ 21M+ 419M+
    12225 SyncServer 0.0% 0:00.15 2 50 290 3512K 41M 12M 88M
    11248 WinAppHelp 0.0% 0:00.40 1 51 289 3208K 40M 11M 339M
    11027 Skype 0.0% 0:19.47 31 313 865 46M 76M 88M 557M
    10315 PrinterPro 0.0% 0:00.83 2 85 476 12M 51M 29M 423M
    10313 launchd 0.0% 0:01.25 3 24 25 120K 296K 464K 18M
    8626 QuickTime 0.0% 17:21.09 5 187 655 13M 67M 43M 486M
    8556 DashboardC 0.0% 0:06.31 4 124 538 16M 58M 38M 436M
    8555 DashboardC 0.0% 0:10.95 4 149 545 23M 58M 49M 444M
    8534 Livestatio 16.8% 59:00.13 12 198 771 30M- 94M 62M 584M
    8220 Mail 0.0% 0:43.91 27 323 968 24M 94M 80M 554M
    2806 Python 0.8% 5:20.05 2 33 281 13M- 248K 14M- 36M-
    2761 Transmissi 0.9% 2:49.17 21 270 773 20M 90M 56M 506M

    About OS X Memory Management and Usage
    Reading system memory usage in Activity Monitor
    Memory Management in Mac OS X
    Performance Guidelines- Memory Management in Mac OS X
    A detailed look at memory usage in OS X
    Understanding top output in the Terminal
    The amount of available RAM for applications is the sum of Free RAM and Inactive RAM. This will change as applications are opened and closed or change from active to inactive status. The Swap figure represents an estimate of the total amount of swap space required for VM if used, but does not necessarily indicate the actual size of the existing swap file. If you are really in need of more RAM that would be indicated by how frequently the system uses VM. If you open the Terminal and run the top command at the prompt you will find information reported on Pageins () and Pageouts (). Pageouts () is the important figure. If the value in the parentheses is 0 (zero) then OS X is not making instantaneous use of VM which means you have adequate physical RAM for the system with the applications you have loaded. If the figure in parentheses is running positive and your hard drive is constantly being used (thrashing) then you need more physical RAM.

  • Having a problem with Excessive "modified" memory usage in Win7 x64, upwards of 3.6GB, any suggestions?

    I have 6GB of ram, a fresh install of Windows 7 x64, and the screenshot shows what happens after leaving my PC on for a couple days. (3782+MB being used by modified memory ATM).
    http://wow.deconstruct.me/images/ExcessiveMemory.jpg
    Any ideas on this?
    Edit:
    Added this after first round of suggestions
    http://wow.deconstruct.me/images/NotSoExcessiveMemory.jpg
    This is uptime of around 2 hours.
    The first image is of uptime of around 3-5 days.

    Matthew,
    The only reason why these pages are kept on the modified list indefinitely is because the system doesn't have any available pagefile space left. If you increase the size of the pagefile the system will write most of these pages to disk and then move them from the modified list to the standby list. Standby pages are considered part of "available memory", because they can be reused for some other purpose if necessary.
    Whether this would "fix" the problem or not depends on what the actual problem is. If it's an unbound memory leak then increasing the size of the pagefile will simply allow the system to run longer before it eventually hits the maximum pagefile size limit, or runs out of disk space. On the other hand, if it's a case of some application allocating a lot of memory and not using it for a long time, then increasing the pagefile might be a perfectly valid solution.
    Allowing the system to manage the size of the pagefile actually works well in most cases. Pagefile fragmentation (at the filesystem level) can only occur when the initially chosen size is not large enough and the system has to extend it at run time. For win7 we have telemetry data that shows that even for systems with 1 GB of RAM, less than 0.1% of all boot sessions end up having to extend the pagefile, and this number is even lower for larger amounts of RAM. If you think you are in that 0.1% and your pagefile might be getting fragmented, you can manually increase its minimum size such that the total system commit charge stays below 80% even if you run all your apps at once (80% is the threshold at which the pagefile is automatically extended). This will make sure the pagefile is created once and then stays at the same size forever, so it can't fragment. The maximum size can either be set to the same value as the minimum, or you can make it larger so that the system is more resilient to memory leaks or unexpectedly high loads.
    By the way, Windows doesn't use pagefiles as "extra memory", it uses them as a backing store for private pages, just like regular files are used as a backing store for EXEs/DLLs and memory mapped files. So if the system really has more than enough RAM (like in your second screenshot, where you have 3.6 GB of free pages) you shouldn't see any reads from the pagefile. You can verify this by going to the Disk tab in the resource monitor and looking for any disk IO from pagefile.sys. On smaller systems that don't have an excess of free pages you may see periodic reads from the pagefile, and this is expected because the total amount of data referenced by the OS/drivers/processes is larger than the total RAM. Forcefully keeping all pagefile-backed pages in memory (which is what disabling the pagefile does) would simply mean some other pages (memory mapped files, DLL code or data etc) would have to be paged out.
    Regarding further troubleshooting steps: If the system runs fine with a larger pagefile (commit charge stabilizes well below 80%, and you no longer see gigabytes of modified pages accumulating in memory) then you don't really need to do anything. If the problem persists, you can check for any processes with an abnormally high commit charge, and also check kernel memory usage in task manager. If it's a kernel leak you can usually narrow it down to a particular driver using poolmon.exe or kernel debugger.

  • Problem with memory usage and CPU usage

    Hello,
    i have a problem with the memory usage and cpu usage in my project!
    My application must run for more than 24 hrs. The problem is that the longer it runs the bigger is the memory and cpu usage!
    It starts with ~15% CPU usage and ~70 MBytes memory usage. After ~ 24hrs the CPU usage is ~60% and the memory usage is ~170 MBytes!
    After  3 days the CPU usage is almost about 70% and the memory usage is about 360 MBytes!
    What can I do to reduce this huge recource usage?
    Thank you!

    Hi Pahe,
       I think the issue is memory usage, since CPU usage can increase due to greater memory requirements.
       Anyway, it's difficult to debug without seeing your code, can you post it (possibly for LV 7.1 compatibility)?  Or just post a JPEG of the piece of code that can give problems...
       I guess you're appending data to an array instead of replace data elements, but I can't be sure...
       Have a nice day!
    graziano

Maybe you are looking for