« Return to Thread: Java integration: Swing string problem

Re: Java integration: Swing string problem

by Thomas E Enebo :: Rate this Message:

Reply to Author | View in Thread

As Bill had mentioned above we have a JavaObject wrapper needs to go
away and when it does we can fix this problem.   We won't need to
convert the Java String into a Ruby String and then recreate it as a
Java String on the way out.   It will just be the Java String the
whole time.

-Tom

On Jan 6, 2008 10:08 AM, Hugh Winkler <hughw@...> wrote:

> On Jan 6, 2008 9:45 AM, Marcin Mielżyński <lopx@...> wrote:
> > Hugh Winkler pisze:
> >
> > > On Jan 6, 2008 9:02 AM, Marcin Mielżyński <lopx@...> wrote:
> > >
> > >
> > >> Interning arbitrary strings is evil, we should avoid this as much as
> > >> possible.
> > >>
> > >>
> > >
> > > What is your reason?
> > >
> > Interned Strings are not GCable, this leads to permgen issues (JRuby has
> > big permgen footprint already).
> >
> >
>
>
> Oh. Well that is a very good reason.
>
> 1. It could be a runtime switch to jruby :
> -Djruby.intern.java.string=true. (along with -XX:MaxPermGen=...) Then
> the developer takes responsibility.
>
> 2. Jruby might apply intern only to "public static final" strings that
> originated with a java import, because that is the real use case. It
> would have to set a flag that travels around with the RubyString
> somehow, to remember to intern the string when needed.
>
> 3. I tried to find a way to call intern from JRuby, but I ended up
> with Ruby strings. My jruby java integration knowledge isn't great,
> and I suspect there might be a way to do that. I'm not sure how much
> an improvement that would be over my workaround, though. It's still
> going to be a surprise for anyone developing a Swing app, some APIs
> they will have to learn to treat specially.
>
> Hugh
>
>
>
> > Marcin.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe from this list please visit:
> >
> >     http://xircles.codehaus.org/manage_email
> >
> >
>



--
Blog: http://www.bloglines.com/blog/ThomasEEnebo
Email: enebo@... , tom.enebo@...

 « Return to Thread: Java integration: Swing string problem