Search Results

Search found 6 results on 1 pages for 'elado'.

Page 1/1 | 1 

  • AppEngine JRuby - OutOfMemoryError: Java heap space - can it be solved?

    - by elado
    I use AppEngine JRuby on Rails (SDK version 1.3.3.1) - a problem I encounter often is that after a few requests the server is getting really SLOW, until it dies and throws OutOfMemoryError on the terminal (OSX). The requests themselves are very lightweight, not more than looking for an entity or saving it, using DataMapper. On appspot, this problem is not happening. Is there any way to enlarge the heap space for JRuby? The exception log: Exception in thread "Timer-2" java.lang.OutOfMemoryError: Java heap space Apr 29, 2010 8:08:22 AM com.google.apphosting.utils.jetty.JettyLogger warn WARNING: Error for /users/close_users java.lang.OutOfMemoryError: Java heap space at org.jruby.RubyHash.internalPut(RubyHash.java:480) at org.jruby.RubyHash.internalPut(RubyHash.java:461) at org.jruby.RubyHash.fastASet(RubyHash.java:837) at org.jruby.RubyArray.makeHash(RubyArray.java:2998) at org.jruby.RubyArray.makeHash(RubyArray.java:2992) at org.jruby.RubyArray.op_diff(RubyArray.java:3103) at org.jruby.RubyArray$i_method_1_0$RUBYINVOKER$op_diff.call(org/jruby/RubyArray$i_method_1_0$RUBYINVOKER$op_diff.gen) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:146) at org.jruby.ast.CallOneArgNode.interpret(CallOneArgNode.java:57) at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.runtime.InterpretedBlock.evalBlockBody(InterpretedBlock.java:373) at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:346) at org.jruby.runtime.InterpretedBlock.yield(InterpretedBlock.java:303) at org.jruby.runtime.Block.yield(Block.java:194) at org.jruby.RubyArray.collect(RubyArray.java:2354) at org.jruby.RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$collect.call(org/jruby/RubyArray$i_method_0_0$RUBYFRAMEDINVOKER$collect.gen) at org.jruby.runtime.callsite.CachingCallSite.callBlock(CachingCallSite.java:115) at org.jruby.runtime.callsite.CachingCallSite.call(CachingCallSite.java:122) at org.jruby.ast.CallNoArgBlockNode.interpret(CallNoArgBlockNode.java:64) at org.jruby.ast.CallNoArgNode.interpret(CallNoArgNode.java:61) at org.jruby.ast.LocalAsgnNode.interpret(LocalAsgnNode.java:123) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.ast.EnsureNode.interpret(EnsureNode.java:98) at org.jruby.ast.BeginNode.interpret(BeginNode.java:83) at org.jruby.ast.NewlineNode.interpret(NewlineNode.java:104) at org.jruby.ast.BlockNode.interpret(BlockNode.java:71) at org.jruby.ast.EnsureNode.interpret(EnsureNode.java:96) at org.jruby.internal.runtime.methods.InterpretedMethod.call(InterpretedMethod.java:201) at org.jruby.internal.runtime.methods.DefaultMethod.call(DefaultMethod.java:183)

    Read the article

  • View Models (ViewData), UserControls/Partials and Global variables - best practice?

    - by elado
    Hi I'm trying to figure out a good way to have 'global' members (such as CurrentUser, Theme etc.) in all of my partials as well as in my views. I don't want to have a logic class that can return this data (like BL.CurrentUser) I do think it needs to be a part of the Model in my views So I tried inheriting from BaseViewData with these members. In my controllers, in this way or another (a filter or base method in my BaseController), I create an instance of the inheriting class and pass it as a view data. Everything's perfect till this point, cause then I have my view data available on the main View with the base members. But what about partials? If I have a simple partial that needs to display a blog post then it looks like this: <%@ Control Language="C#" AutoEventWireup="true" Inherits="ViewUserControl<Post>" %> and simple code to render this partial in my view (that its model.Posts is IEnumerable<Post>): <%foreach (Post p in this.Model.Posts) {%> <%Html.RenderPartial("Post",p); %> <%}%> Since the partial's Model isn't BaseViewData, I don't have access to those properties. Hence, I tried to make a class named PostViewData which inherits from BaseViewData, but then my containing views will have a code to actually create the PostViewData in them in order to pass it to the partial: <%Html.RenderPartial("Post",new PostViewData { Post=p,CurrentUser=Model.CurrentUser,... }); %> Or I could use a copy constructor <%Html.RenderPartial("Post",new PostViewData(Model) { Post=p }); %> I just wonder if there's any other way to implement this before I move on. Any suggestions? Thanks!

    Read the article

  • Is it possible to run locally JRuby on Google App Engine without restarting server on every change?

    - by elado
    Unfortunately, GAE requires restart of the server on each code change. Is it possible to prevent it and have immediate feedback after code save? Or, can I import Google App Engine's API into my ruby code and run it on Sinatra server? Tried this but it fails on "import com.google.appengine.api" (it doesn't know what 'com' is). For Sinatra, I use "Rerun" ( http://github.com/alexch/rerun ) which restarts server immediately after a change with minimum wait. Thanks.

    Read the article

  • ASP.NET MVC - Combine Json result with ViewResult

    - by elado
    Can I return a Json result that contains also a rendered view? I need it to return the new ID of a submitted form along with its HTML and some other properties. Also that can be helpful when I need to return two (or more) view results from one action inside a Json object. Thanks!

    Read the article

  • Smart Background Thread Task in Ruby on Rails?

    - by elado
    I need to perform a task every 5 seconds, but only when users are using the application. As for now, I use cron that works every minute and activates a task that repeats itself every 5 seconds with sleeps between, for a minute. However, it works also when the application isn't being used. Is there a gem that will do this kind of thing?

    Read the article

1