Results 1 to 7 of 7
  1. #1
    Join Date
    Nov 2012
    Posts
    6

    Unanswered: Db2 and windows 7 standby memory

    I have an application which operates on top of a DB2 database. It receives data from a data source over ethernet and uses these to build transactions which are recorded in the database.

    The program was originally developed for Windows Server 2003/Windows XP. We have recently begun to start running it under Windows Server 2008/Windows 7.

    And when we do this, we are starting to notice a serious performance drop after the application has been running for a few days. It appears to be having a significant fight with Windows 7 for memory. Lots of paging et al.

    Okay, so what is happening to our memory? We used the tool RamMap to look at what was happening to our memory , and what we noticed is that our standby memory was filling up with Db2 log files.

    "Standby memory" in windows 7 is explained at this link . When a program finishes with a section of memory, the memory is not simply freed. Instead, it is kept in standby memory as a hot standby in case the program wants it again in a hurry.

    Except it doesn't seem to work in all cases.

    Example 1

    Example 2 .

    In this person's case, his standby memory is filling up with .zip files. I believe my problem is similar: My standby memory is filling up with .log files, and that standby memory is not being released because Windows 7 thinks DB2 still has interest in that memory. The result is that I'm starting to suffer from loss of memory.

    So : Has anyone else experienced this problem? How did you fix it?

    Respectfully,

    Brian P.

  2. #2
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    What is your DB2 version/fixpack? Is your OS/DB2 32-bit or 64-bit? How much memory does the server have and how much of it is allocated to DB2 (ie. bufferpools, sorts, etc...)? Do you see any memory related messages in db2diag.log?

  3. #3
    Join Date
    Nov 2012
    Posts
    6
    Quote Originally Posted by db2girl View Post
    What is your DB2 version/fixpack?
    DB2 Express 9.1.200.98 .

    Is your OS/DB2 32-bit or 64-bit?
    OS is 64-bit

    DB2 is 32-bit.

    How much memory does the server have and how much of it is allocated to DB2 (ie. bufferpools, sorts, etc...)?
    server has 4GB of installed memory

    Bufferpool is 7.8 MB.

    All DB2 processes currently in memory seem to use about
    175MB altogether.

    Do you see any memory related messages in db2diag.log?
    I see a number of event messages from the self tuning
    memory manager of the form

    "STMM log file removed automatically to maintain space constraint".

    but no specific memory errors. Not since April, anyway.

    Based on these answers, I can already see some potential improvement: I am going to recommend that we download a later version of Db2 purpose-built for Windows 7 , preferably one that is also 64-bit. I am also going to suggest that maybe 4GB is a touch low memory for a server.

    Thanks for the attention! Do you have any suggestions?

    Respectfully,

    Brian P.

  4. #4
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    Quote Originally Posted by pendell View Post

    OS is 64-bit

    DB2 is 32-bit.
    If OS is 64-bit, DB2 instance must be 64-bit as well. Execute "db2level" command to verify.


    Quote Originally Posted by pendell View Post
    Bufferpool is 7.8 MB.

    All DB2 processes currently in memory seem to use about
    175MB altogether.
    Are you sure? This is nothing for DB2. Execute "db2 get db cfg for <db name> show detail" and check database_memory value.

  5. #5
    Join Date
    Nov 2012
    Posts
    6
    Quote Originally Posted by db2girl View Post
    If OS is 64-bit, DB2 instance must be 64-bit as well. Execute "db2level" command to verify.
    "db2level" executed. result:

    "Instance "DB2" uses "32" bits and DB2 code release "SQL09012" with level identifier "01030107"

    Informational tokens are "DB2 v9.1.200.166", "special_17369", "WR1380_17369", and Fix Pack "2"

    ---

    Double-checked, and the OS is verified as 64 bit under computer properties.

    Are you sure? This is nothing for DB2. Execute "db2 get db cfg for <db name> show detail" and check database_memory value.
    Executed. size of Database shared memory (4kb) AUTOMATIC (68820).

    I suppose that means 68820 * 4kb = 275280 kb, or 268 MB. As you say, it's nothing for DB2.

    Which leads me to believe, if I'm not chasing the wrong rabbit trail, that it doesn't have anything to do with DB2 *itself* but with the way Windows interacts with it. Observe this memory map .

    Notice the db2 log files in db2_logs. As more log files are generated, that share of standby memory does not decrease. While I've never seen Db2 itself have a problem, I've seen our application start doing some paging when communicating with the ethernet, with resultant loss of performance.

    Respectfully,

    Brian P.

  6. #6
    Join Date
    Aug 2008
    Location
    Toronto, Canada
    Posts
    2,367
    OS bitness = DB2 instance bitness starting with v9.1

    If you look in db2diag.log (first few lines), it will tell you if your OS is 32-bit or 64-bit; based on db2level output, 32-bit.

    I don't know anything about "standby memory" or RamMap tool... but it looks like OS is caching some files, including db2 files, in this standby memory? Don't know why it needs to cache db2 backup image.. Are the db logs listed in RamMap output all active logs? What does "db2pd -d <db name> -logs" and "db2 get db cfg for <db name>" show?

  7. #7
    Join Date
    Nov 2012
    Posts
    6
    Quote Originally Posted by db2girl View Post
    OS bitness = DB2 instance bitness starting with v9.1

    If you look in db2diag.log (first few lines), it will tell you if your OS is 32-bit or 64-bit; based on db2level output, 32-bit.

    I don't know anything about "standby memory" or RamMap tool... but it looks like OS is caching some files, including db2 files, in this standby memory? Don't know why it needs to cache db2 backup image.. Are the db logs listed in RamMap output all active logs? What does "db2pd -d <db name> -logs" and "db2 get db cfg for <db name>" show?

    db2pd tells me that my current active logs are in the 9400 range, quite above the number you saw. But then, the image capture is now a few days old. Just did a current map, and none of the active logs is listed in the current standby memory.

    My understanding is that standby memory contains memory an application recently used but isn't using now. The idea being, the application may very well ask for almost exactly the same memory requirements again in the near future, so rather than throwing the recently de-allocated memory back into the "free" pool and having to re-allocate from scratch, the memory is kept "hot" in standby so that, if the app asks for almost the same memory again,
    we throw back the memory it just used rather than have to get a whole new set from scratch.

    In theory.

    In practice, it appears that memory is being allocated when the log files are created but it is not being released. So instead of re-using the memory in standby, the standby memory accumulates a collection of useless log files, choking the rest of the system.

    Respectfully,

    Brian P.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •