Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jme3-core: MemoryUtils - incorrect character ‘ #2184

Closed
capdevon opened this issue Jan 11, 2024 · 0 comments · Fixed by #2185
Closed

jme3-core: MemoryUtils - incorrect character ‘ #2184

capdevon opened this issue Jan 11, 2024 · 0 comments · Fixed by #2185
Assignees
Milestone

Comments

@capdevon
Copy link
Contributor

capdevon commented Jan 11, 2024

wrong character accent ‘ -> '
The code was probably copied and pasted from the forum.

https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-core/src/main/java/com/jme3/util/MemoryUtils.java#L73

Logger.getLogger(MemoryUtils.class.getName()).log(Level.SEVERE, "Error retrieving ‘MemoryUsed’", ex); // <-- should be 'MemoryUsed'

https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-core/src/main/java/com/jme3/util/MemoryUtils.java#L87

Logger.getLogger(MemoryUtils.class.getName()).log(Level.SEVERE, "Error retrieving ‘Count’", ex); // <-- should be 'Count'

https://github.com/jMonkeyEngine/jmonkeyengine/blob/master/jme3-core/src/main/java/com/jme3/util/MemoryUtils.java#L102

Logger.getLogger(MemoryUtils.class.getName()).log(Level.SEVERE, "Error retrieving ‘TotalCapacity’", ex); // <-- should be 'TotalCapacity'

Here is how the character ' is displayed in my editor:

    /**
     * 
     * @return the direct memory used in byte.
     */
    public static long getDirectMemoryUsage() {
        try {
            Long value = (Long)mbeans.getAttribute(directPool, "MemoryUsed");
            return value == null ? -1 : value;
        } catch (JMException ex) {
            Logger.getLogger(MemoryUtils.class.getName()).log(Level.SEVERE, "Error retrieving ‘MemoryUsed’", ex); // <--
            return -1;
        }
    }

    /**
     * 
     * @return the number of direct buffer used
     */
    public static long getDirectMemoryCount() {
        try {
            Long value = (Long)mbeans.getAttribute(directPool, "Count");
            return value == null ? -1 : value;
        } catch (JMException ex) {
            Logger.getLogger(MemoryUtils.class.getName()).log(Level.SEVERE, "Error retrieving ‘Count’", ex); // <--
            return -1;
        }
    }

    /**
     * 
     * @return Should return the total direct memory available, result seem off
     * see post http://jmonkeyengine.org/forum/topic/monitor-direct-memory-usage-in-your-app/#post-205999
     */
    public static long getDirectMemoryTotalCapacity() {
        try {
            Long value = (Long)mbeans.getAttribute(directPool, "TotalCapacity");
            return value == null ? -1 : value;
        } catch (JMException ex) {
            Logger.getLogger(MemoryUtils.class.getName()).log(Level.SEVERE, "Error retrieving ‘TotalCapacity’", ex); // <--
            return -1;
        }
    }
@capdevon capdevon changed the title MemoryUtils: Incorrect character ‘ jme3-core: MemoryUtils - incorrect character ‘ Jan 11, 2024
@stephengold stephengold self-assigned this Jan 11, 2024
@stephengold stephengold linked a pull request Jan 12, 2024 that will close this issue
@stephengold stephengold added this to the Future Release milestone Jan 12, 2024
@stephengold stephengold modified the milestones: Future Release, v3.7.0 Oct 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants