Skip to content

Instantly share code, notes, and snippets.

View davidray's full-sized avatar

David Christiansen davidray

  • SyncTimes
  • Springville, UT
View GitHub Profile
On Fri, Jun 19, 2009 at 2:12 AM, Michael Gannon <michael.gannon@gmail.com> wrote:
Hi List,
We have been pushing our application with some performance testing of late and during these tests we are experiencing some PermGen out-of-memory problems using JRuby 1.2.0 + Rails 2.2.2. Our application is a multithreaded app, a main thread with a number of worker threads. The worker threads are fairly simple really, mainly making use of ActiveRecord libraries, then we simply let them die.
For our testing we have increased the heap size and only now are we encountering a PermGen problem. I have read the article by Nick Sieger (http://blog.nicksieger.com/articles/2008/02/21/jruby-and-the-permanent-generation) but what isn't clear is how to estimate the required PermGen size, when is enough enough? Is there a reason why we are only encountering the problem after increasing the heap size?
We as yet have not changed the default PermGen sizes so they are as default (64m max?) as we want to understand what
Jun 8, 2009 1:22:36 AM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performanc
e in production environments was not found on the java.library.path: /usr/local/
jdk1.6.0_07/jre/lib/amd64/server:/usr/local/jdk1.6.0_07/jre/lib/amd64:/usr/local
/jdk1.6.0_07/jre/../lib/amd64:/usr/java/packages/lib/amd64:/lib:/usr/lib
Jun 8, 2009 1:22:36 AM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Jun 8, 2009 1:22:36 AM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 464 ms
Jun 8, 2009 1:22:36 AM org.apache.catalina.core.StandardService start
"Sort (cost=377.39..377.41 rows=8 width=1440) (actual time=68.444..68.698 rows=182 loops=1)"
" Sort Key: (ts_rank(people.vector, to_tsquery('reyes | r200'::text))), people.last_name, people.first_name, entities.id, events.event_onset_date"
" Sort Method: quicksort Memory: 118kB"
" -> Nested Loop Left Join (cost=2.42..377.27 rows=8 width=1440) (actual time=16.683..58.697 rows=182 loops=1)"
" -> Nested Loop (cost=2.42..374.68 rows=8 width=1396) (actual time=16.489..48.656 rows=182 loops=1)"
" -> Nested Loop (cost=2.42..333.38 rows=10 width=888) (actual time=16.408..43.144 rows=182 loops=1)"
" -> Nested Loop (cost=2.42..328.57 rows=13 width=721) (actual time=16.313..37.381 rows=182 loops=1)"
" -> Bitmap Heap Scan on people (cost=2.42..40.31 rows=21 width=156) (actual time=16.119..23.940 rows=239 loops=1)"
" Filter: (vector @@ to_tsquery('reyes | r200'::text))"
" -> Bitmap
NoMethodError in Morbidity_events#edit
Showing app/views/events/_diagnostic_show.html.haml where line #30 raised:
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.place
Extracted source (around line #30):
27: - fields_for(event_type + "[diagnostic_facilities_attributes][#{uniq_id}]", @diagnostic) do |pe|
2009-06-08 14:29:37] [DEBUG] FormElement Load (1.0ms) SELECT * FROM "form_elements" WHERE ("form_elements"."name" = '') AND ("form_elements".parent_id = 62694) LIMIT 1
[2009-06-08 14:29:37] [WARN ] <NoMethodError> undefined method `code' for nil:NilClass
/srv/tomcat6/utnedss/WEB-INF/app/models/answer.rb:113:in `set_answer_code'
/srv/tomcat6/utnedss/WEB-INF/app/models/answer.rb:98:in `before_save'
/usr/local/tomcat6/webapps/utnedss/WEB-INF/gems/gems/activerecord-2.3.2/lib/active_record/callbacks.rb:347:in `callback'
/usr/local/tomcat6/webapps/utnedss/WEB-INF/gems/gems/activerecord-2.3.2/lib/active_record/callbacks.rb:249:in `create_or_update_with_callbacks'
/usr/local/tomcat6/webapps/utnedss/WEB-INF/gems/gems/activerecord-2.3.2/lib/active_record/base.rb:2539:in `save'
/usr/local/tomcat6/webapps/utnedss/WEB-INF/gems/gems/activerecord-2.3.2/lib/active_record/validations.rb:1009:in `save_with_validation'
/usr/local/tomcat6/webapps/utnedss/WEB-INF/gems/gems/activerecord-2.3.2/lib/active_record/dirty.rb:
@davidray
davidray / gist:126036
Created June 8, 2009 20:17
DB Server
8178884 total memory
7932272 used memory
4767144 active memory
2976724 inactive memory
246612 free memory
506780 buffer memory
7126120 swap cache
4194296 total swap
160 used swap
4194136 free swap
4048176 total memory
2783704 used memory
2099144 active memory
568768 inactive memory
1264472 free memory
291924 buffer memory
1097864 swap cache
4194296 total swap
92 used swap
4194204 free swap
#!/bin/sh
# Copyright (c) 1995-2004 SUSE Linux AG, Nuernberg, Germany.
# All rights reserved.
#
# Author: Kurt Garloff
# Please send feedback to http://www.suse.de/feedback/
#
# /etc/init.d/postgresql
# and its symbolic link
# /(usr/)sbin/rcpostgresql
silent_mode | off | Runs the server silently.
log_autovacuum_min_duration | 0 | Sets the minimum execution time above which autovacuum actions will be logged.
log_checkpoints | on | Logs each checkpoint.
log_connections | off | Logs each successful connection.
log_destination | stderr | Sets the destination for server log output.
log_directory | pg_log | Sets the destination directory for log files.
log_disconnections | off | Logs end of a session, including duration.
log_duration | off | Logs the duration of each completed SQL statement.
log_error_verbosity | default | Sets the verbosity of l
java.lang.OutOfMemoryError: PermGen space
at sun.misc.Unsafe.defineClass(Native Method)
at sun.reflect.ClassDefiner.defineClass(ClassDefiner.java:45)
at sun.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:381)
at java.security.AccessController.doPrivileged(Native Method)
at sun.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:377)
at sun.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:76)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:30)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)