You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-dev@db.apache.org by "Kristian Waagan (JIRA)" <ji...@apache.org> on 2008/07/18 15:52:31 UTC

[jira] Updated: (DERBY-3731) Improve calculation of refSize in ClassSize.java

     [ https://issues.apache.org/jira/browse/DERBY-3731?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Kristian Waagan updated DERBY-3731:
-----------------------------------

    Attachment: derby-3731-1a-refsize_from_properties.diff

'derby-3731-1a-refsize_from_properties.diff' is a first shot at
determining the reference size by looking at system properties.

I got the following results from a run on my own machine when specifying
-d64 for the VM, using Sun JDK 1.6:
### model: 8 (sun.arch.data.model)
### arch amd64: 8 (os.arch)
### sz: -26 (sz calculated by heuristic)
### REFERENCE SIZE: 4 (final value calculated by heuristic)

As you can see, in this case the estimation was off and the results are
reproducible.  However, when I tried the same with JDK 1.5, the
estimation was correct.

There's a few things I haven't checked with the patch:
 a) Do we need some extra permissions?
    I was able to run with the default policy file.
 b) Do we need to document the permissions?
 c) Should the code be more defensive in making sure the data model code
    returns either 4 or 8?
 d) Is using 'os.arch' worth the hassle?
 e) How many values are there for 'os.arch'?

Comments on this issue (and the patch) are welcome.
If people think it is a safe enough change, I would suggest to commit
the final version and see how it works out with the test runs. We have
individuals running off trunk, we have the tinderbox and the nighly
tests.
I also believe we have people developing on various platforms
(Solaris, Linux, Windows, Mac, maybe more).

> Improve calculation of refSize in ClassSize.java 
> -------------------------------------------------
>
>                 Key: DERBY-3731
>                 URL: https://issues.apache.org/jira/browse/DERBY-3731
>             Project: Derby
>          Issue Type: Bug
>          Components: SQL
>            Reporter: Kathey Marsden
>            Priority: Minor
>         Attachments: derby-3731-1a-refsize_from_properties.diff, DERBY-3731_diff.txt
>
>
> java/engine/org/apache/derby/iapi/services/cache/ClassSize.java has a static code block which calculates the size of a reference for the architecture.  This code could be improved by adding garbage collection before measuring memory, to give a consistent  reading.     Also there have been suggestions that we use os.arch or sun.arch.data.model to make the measurement more reliable, especially on 64bit machines.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.