Re: Memory Leak
did you repeat with the same image or show different ones?
High Quality Resources for Collectible Card Games and Home of the CCGHQ Team
https://www.slightlymagic.net/forum/
https://www.slightlymagic.net/forum/viewtopic.php?f=52&t=2075
nantuko84 wrote:here are the results of testing:
1. without any images:
I played 5 games starting with 76 Mb in task manager
once 5th was started, I had 78 Mb allocated that means no memory leak in the program
2. I've downloaded some images
started a new game (again with about 76 Mb allocated)
all cards were text except one (Nevinnyral's Disk, but it doesn't matter)
I put mouse over the card with image so it was displayed at the right, then enlarge it putting mouse cursor over image.
I repeated this 20 times and now I had 122 Mb allocated.
when I started a next game, and it had already 121 Mb allocated instead of starting 76 Mb - so here is the source of your memory leak
regards
Yes, however, when I start a new game, memory is still not freed up. I mean, I don't know, maybe stuff will automatically get freed once my computer's running low on memory...with different images, it's clear that memory grows. important is that a single image is reused when shown repeatedly:
I can give a basic answer for that.mtgrares wrote:One good question would be, "How much memory is used by the Java Virtual Machine to display 10-20 HQ images?" This number would be a good "base" requirement.
An error has occured. You can copy/paste this message or save it to a file.
Please report this, plus what you tried to do, to:
http://www.slightlymagic.net/forum/viewforum.php?f=26
If you don't want to register an account, you can mail it directly to
mtgerror@yahoo.com
Java heap space
Version:
Forge -- official beta: 10/01/01, SVN revision: 269
Detailed error trace:
java.lang.OutOfMemoryError: Java heap space
at java.awt.image.DataBufferByte.<init>(DataBufferByte.java:59)
at java.awt.image.ComponentSampleModel.createDataBuffer(ComponentSampleModel.java:397)
at java.awt.image.Raster.createWritableRaster(Raster.java:938)
at javax.imageio.ImageTypeSpecifier.createBufferedImage(ImageTypeSpecifier.java:1056)
at javax.imageio.ImageReader.getDestination(ImageReader.java:2879)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.readInternal(JPEGImageReader.java:925)
at com.sun.imageio.plugins.jpeg.JPEGImageReader.read(JPEGImageReader.java:897)
at javax.imageio.ImageIO.read(ImageIO.java:1422)
at javax.imageio.ImageIO.read(ImageIO.java:1282)
at forge.GuiDisplayUtil.getPictureHQwidth(GuiDisplayUtil.java:476)
at forge.Gui_DeckEditor$CustomListener.mouseEntered(Gui_DeckEditor.java:877)
at java.awt.Component.processMouseEvent(Component.java:6357)
at javax.swing.JComponent.processMouseEvent(JComponent.java:3255)
at java.awt.Component.processEvent(Component.java:6113)
at java.awt.Container.processEvent(Container.java:2085)
at java.awt.Component.dispatchEventImpl(Component.java:4714)
at java.awt.Container.dispatchEventImpl(Container.java:2143)
at java.awt.Component.dispatchEvent(Component.java:4544)
at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
at java.awt.LightweightDispatcher.trackMouseEnterExit(Container.java:4407)
at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4264)
at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
at java.awt.Container.dispatchEventImpl(Container.java:2129)
at java.awt.Window.dispatchEventImpl(Window.java:2475)
at java.awt.Component.dispatchEvent(Component.java:4544)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
An error has occured. You can copy/paste this message or save it to a file.
Please report this, plus what you tried to do, to:
http://www.slightlymagic.net/forum/viewforum.php?f=26
If you don't want to register an account, you can mail it directly to
mtgerror@yahoo.com
You requested a full error report
Version:
Forge -- official beta: 10/01/01, SVN revision: 269
Detailed error trace:
Java2D Disposer (12):
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
sun.java2d.Disposer.run(Disposer.java:125)
java.lang.Thread.run(Thread.java:637)
AWT-EventQueue-0 (13):
java.lang.Thread.dumpThreads(Native Method)
java.lang.Thread.getAllStackTraces(Thread.java:1511)
forge.error.ErrorViewer.printError(ErrorViewer.java:140)
forge.error.ErrorViewer.showErrorAllThreads(ErrorViewer.java:98)
forge.error.ErrorViewer$ShowAllThreadsAction.actionPerformed(ErrorViewer.java:210)
javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2028)
javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2351)
javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:387)
javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:242)
javax.swing.AbstractButton.doClick(AbstractButton.java:389)
javax.swing.plaf.basic.BasicMenuItemUI.doClick(BasicMenuItemUI.java:1223)
com.apple.laf.AquaMenuItemUI.doClick(AquaMenuItemUI.java:137)
javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(BasicMenuItemUI.java:1264)
java.awt.Component.processMouseEvent(Component.java:6348)
javax.swing.JComponent.processMouseEvent(JComponent.java:3255)
java.awt.Component.processEvent(Component.java:6113)
java.awt.Container.processEvent(Container.java:2085)
java.awt.Component.dispatchEventImpl(Component.java:4714)
java.awt.Container.dispatchEventImpl(Container.java:2143)
java.awt.Component.dispatchEvent(Component.java:4544)
java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4618)
java.awt.LightweightDispatcher.processMouseEvent(Container.java:4282)
java.awt.LightweightDispatcher.dispatchEvent(Container.java:4212)
java.awt.Container.dispatchEventImpl(Container.java:2129)
java.awt.Window.dispatchEventImpl(Window.java:2475)
java.awt.Component.dispatchEvent(Component.java:4544)
java.awt.EventQueue.dispatchEvent(EventQueue.java:635)
java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:296)
java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:211)
java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:201)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:196)
java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:188)
java.awt.EventDispatchThread.run(EventDispatchThread.java:122)
AWT-AppKit (10):
Reference Handler (2):
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:485)
java.lang.ref.Reference$ReferenceHandler.run(Reference.java:116)
AWT-Shutdown (11):
java.lang.Object.wait(Native Method)
java.lang.Object.wait(Object.java:485)
sun.awt.AWTAutoShutdown.run(AWTAutoShutdown.java:259)
java.lang.Thread.run(Thread.java:637)
DestroyJavaVM (14):
TimerQueue (15):
java.lang.Object.wait(Native Method)
javax.swing.TimerQueue.run(TimerQueue.java:232)
java.lang.Thread.run(Thread.java:637)
Signal Dispatcher (5):
Finalizer (3):
java.lang.Object.wait(Native Method)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:118)
java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:134)
java.lang.ref.Finalizer$FinalizerThread.run(Finalizer.java:159)
`DennisBergkamp wrote:Ah, I haven't actually updated the Deck Editor image displaying yet, it still the old wayHow long did it take before you go the error?
The new (in-game) way of displaying cards also breaks the full-size image feature (when hovering over) Vasiliy added.
`DennisBergkamp wrote:Wait, so the big pictures aren't displaying for you in the bottom right ? (I know the full "zoom" isn't working, but large pictures should still be displayed in picture panel).

`DennisBergkamp wrote:Ah, wow. Weird... did you add google-collect-1.0.jar and jsr305.jar to your build path? I'm assuming you did, because I don't think stuff would even compile without those.
EDIT: I just imported the latest SVN and added it to a new project, then added all libraries in /res/lib. Images show up just fine for me... perhaps it's a Mac specific thing? I'll test this on a Mac at a friend's house. Are you getting any error message when you select a card by the way?
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
<classpathentry kind="lib" path="/Users/chrish******/workspace/ForgeSVN/res/lib/google-collect-1.0.jar"/>
<classpathentry kind="lib" path="/Users/chrish******/workspace/ForgeSVN/res/lib/jdom-1.0.jar"/>
<classpathentry kind="lib" path="/Users/chrish******/workspace/ForgeSVN/res/lib/jl1.0.1.jar"/>
<classpathentry kind="lib" path="/Users/chrish******/workspace/ForgeSVN/res/lib/jsr305.jar"/>
<classpathentry kind="lib" path="/Users/chrish******/workspace/ForgeSVN/res/lib/napkinlaf-1.2.jar"/>
<classpathentry kind="lib" path="/Users/chrish******/workspace/ForgeSVN/res/lib/napkinlaf-swingset-1.2.jar"/>
<classpathentry kind="lib" path="/Users/chrish******/workspace/ForgeSVN/res/lib/nimrodlf.jar"/>
<classpathentry kind="lib" path="/Users/chrish******/workspace/ForgeSVN/res/lib/substance.jar"/>
<classpathentry kind="output" path="bin"/>
</classpath>