Jump to content

RTF Export Template: Throwing exception Out Of Memory (Java Heap)


schir1964

Recommended Posts

I think the RTF code is too large (12 Megabytes) and is causing the program to run out of space for processing.

 

Here's the exception being thrown.

Exception in thread "AWT-EventQueue-0" java.lang.OutOfMemoryError: Java heap space
	at java.lang.StringCoding$StringDecoder.decode(Unknown Source)
	at java.lang.StringCoding.decode(Unknown Source)
	at java.lang.StringCoding.decode(Unknown Source)
	at java.lang.String.<init>(Unknown Source)
	at java.lang.String.<init>(Unknown Source)
	at com.hero.util.HTMLWriter.<init>(Unknown Source)
	at com.hero.HeroDesigner.exportActiveCharacter(Unknown Source)
	at com.hero.HeroDesigner.access$500(Unknown Source)
	at com.hero.HeroDesigner$18.actionPerformed(Unknown Source)
	at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
	at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
	at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
	at javax.swing.AbstractButton.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI.doClick(Unknown Source)
	at javax.swing.plaf.basic.BasicMenuItemUI$Handler.mouseReleased(Unknown Source)
	at java.awt.Component.processMouseEvent(Unknown Source)
	at javax.swing.JComponent.processMouseEvent(Unknown Source)
	at java.awt.Component.processEvent(Unknown Source)
	at java.awt.Container.processEvent(Unknown Source)
	at java.awt.Component.dispatchEventImpl(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
	at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
	at java.awt.Container.dispatchEventImpl(Unknown Source)
	at java.awt.Window.dispatchEventImpl(Unknown Source)
	at java.awt.Component.dispatchEvent(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$500(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)

 

The plan was to just dump out the original RTF untouched to see if looked okay and then start replacing the hard coded values with Export Tags. The dump worked but it was corrupted with the empty line prepended to it due to the Export Tags being remove (the file description and so forth).

I then went to remove the spaces the from file using the Regular Expression Replace tags. That's when this error began being thrown. Even after I removed the replacement tags it still threw the out of memory error. Even after shutting everything down and restarting it throws the error now.

 

<!--TEMPLATE_NAME-->6th Edition RTF Export - Two Column<!--/TEMPLATE_NAME-->
<!--TEMPLATE_DESCRIPTION-->
<span style="font-weight: bold;">Author:</span> Christopher Mullins<br>
<span style="font-weight: bold;">Version:</span> 1.0.2<br>
<span style="font-weight: bold;">Date:</span> (11/11/2021)<br>
<hr>
<span style="color: maroon; font-weight: bold; text-decoration: underline;">Important!</span><br>
DreadDomains created this character sheet style and format.<br>
I just used one his sample RTF files to fill in the HeroDesigner export fields to create the template.
<br>
<span style="font-weight: bold; text-decoration: underline;">Notes</span><br>
For character image you need to edit the RTF file in Word or some other program and add it yourself.
RTF requires the image be encoded and embedded in the RTF file.not get split in half if it overflows the existing page.
<!--/TEMPLATE_DESCRIPTION-->
<!--FILE_EXTENSION-->rtf<!--/FILE_EXTENSION-->
{RTF Code}

 

Any thoughts?

 

 

trace.log appPrefs.xml

Link to comment
Share on other sites

  • schir1964 changed the title to Issue with Hero Designer: Removed and installed from scratch. Throws error when opening Hero Designer
  • schir1964 changed the title to RTF Export Template: Throwing exception Out Of Memory (Java Heap)

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...