summaryrefslogtreecommitdiff
path: root/ext/objspace
AgeCommit message (Collapse)Author
2013-11-14objspace_dump.c: refine outputnobu
* ext/objspace/objspace_dump.c (dump_output): allow IO object as output, and use Tempfile.create and return open file instead of mkstemp() and path name for :file output. [ruby-core:58266] [Bug #9102] * test/objspace/test_objspace.rb (TestObjSpace#dump_my_heap_please): remove temporary output file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43679 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-11* internal.h: move common string/hash flags to include file.tmm1
* ext/objspace/objspace_dump.c: remove flags shared above. * hash.c: ditto. * string.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43647 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09objspace_dump.c: fix declarationnobu
* ext/objspace/objspace_dump.c (dump_output): fix declaration, mkstemp() needs a writable buffer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43615 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09* ext/objspace/object_tracing.c: use declarations in internal.h.nari
* ext/objspace/objspace.c: ditto git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43613 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09objspace_dump.c: fix portability issuenobu
* ext/objspace/objspace_dump.c (dump_output): fix portability issue. mkstemp() may not be available. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43608 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09objspace_dump.c: extract output option utilitiesnobu
* ext/objspace/objspace_dump.c (dump_output, dump_result): extract output option utility functions from objspace_dump() and objspace_dump_all(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43607 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09objspace_dump.c: suppress warningsnobu
* ext/objspace/objspace_dump.c (dump_object): remove unused variables, and cast size_t to long. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43606 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-09objspace_dump.c: indentnobu
* ext/objspace/objspace_dump.c: adjust indent. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43605 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-08* ext/objspace/object_tracing.c: Add experimental methods to dumptmm1
objectspace as json: ObjectSpace.dump_all and ObjectSpace.dump(obj). These methods are useful for debugging reference leaks and memory growth in large ruby applications. [Bug #9026] [ruby-core:57893] [Fixes GH-423] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43585 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-07* ext/objspace/object_tracing.c: [DOC] trace_object_allocations_stopzzak
By @srawlins [Fixes GH-421] https://github.com/ruby/ruby/pull/421 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43572 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-11-05* gc.c: add support to estimate increase of oldspace memory usage.ko1
This is another approach to solve an issue discussed at r43530. This feature is diabled as default. This feature measures an increment of memory consuption by oldgen objects. It measures memory consumption for each objects when the object is promoted. However, measurement of memory consumption is not accurate now. So that this measurement is `estimation'. To implement this feature, move memsize_of() function from ext/objspace/objspace.c and expose rb_obj_memsize_of(). Some memsize() functions for T_DATA (T_TYPEDDATA) have problem to measure memory size, so that we ignores T_DATA objects now. For example, some functions skip NULL check for pointer. The macro RGENGC_ESTIMATE_OLDSPACE enables/disables this feature, and turned off as default. We need to compare 3gen GC and this feature carefully. (it is possible to enable both feature) We need a help to compare them. * internal.h: expose rb_obj_memsize_of(). * ext/objspace/objspace.c: use rb_obj_memsize_of() function. * cont.c (fiber_memsize): fix to check NULL. * variable.c (autoload_memsize): ditto. * vm.c (vm_memsize): ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-29* add RUBY_TYPED_FREE_IMMEDIATELY to data types which only useko1
safe functions during garbage collection such as xfree(). On default, T_DATA objects are freed at same points as fianlizers. This approach protects issues such as reported by [ruby-dev:35578]. However, freeing T_DATA objects immediately helps heap usage. Most of T_DATA (in other words, most of dfree functions) are safe. However, we turned off RUBY_TYPED_FREE_IMMEDIATELY by default for safety. * cont.c: ditto. * dir.c: ditto. * encoding.c: ditto. * enumerator.c: ditto. * error.c: ditto. * file.c: ditto. * gc.c: ditto. * io.c: ditto. * iseq.c: ditto. * marshal.c: ditto. * parse.y: ditto. * proc.c: ditto. * process.c: ditto. * random.c: ditto. * thread.c: ditto. * time.c: ditto. * transcode.c: ditto. * variable.c: ditto. * vm.c: ditto. * vm_backtrace.c: ditto. * vm_trace.c: ditto. * ext/bigdecimal/bigdecimal.c: ditto. * ext/objspace/objspace.c: ditto. * ext/stringio/stringio.c: ditto. * ext/strscan/strscan.c: ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43466 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-28* common.mk, ext/objspace/depend, ext/coverage/depend,akr
ext/-test-/debug/depend, ext/date/depend: Update dependencies. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-17* ext/objspace/object_tracing.c (newobj_i): fix memory leak.ko1
There is possibility to remain info due to missing FREEOBJ event. FREEOBJ events are skipped while suppress_tracing state, for example, during trace events are invoking. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43327 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16* ext/objspace/object_tracing.c (newobj_i): add workaround.ko1
some bugs hits this check. * ext/objspace/object_tracing.c (object_allocations_reporter_i): cast as pointer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43318 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16* ext/objspace/object_tracing.c: add new methodko1
ObjectSpace.trace_object_allocations_debug_start for GC debugging. If you encounter the BUG "... is T_NONE" (and so on) on your application, please try this method at the beggining of your app. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-16* ext/objspace/objspace.c: add a new method `reachable_objects_from_root'.ko1
ObjectSpace.reachable_objects_from_root returns all objects refered from root (called "root objects"). This feature is for deep object analysis. * test/objspace/test_objspace.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43301 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-10-11* ext/objspace/gc_hook.c: prohibit reentrant.ko1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43253 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30* ext/objspace/objspace.c: [DOC] Cleaned up many rdoc formattingzzak
issues and several duplicate grammar bugs. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43099 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30* ext/objspace/object_tracing.c: [DOC] Adjust rdoc formatting and fixzzak
small grammar typo git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43097 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30* ext/objspace/object_tracing.c: [DOC] add some nots forko1
ObjectSpace::trace_object_allocations. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43096 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-30* ext/objspace/object_tracing.c: add new 3 methods to control tracing.ko1
* ObjectSpace::trace_object_allocations_start * ObjectSpace::trace_object_allocations_stop * ObjectSpace::trace_object_allocations_clear And some refactoring. * test/objspace/test_objspace.rb: add a test for new methods. * NEWS: add a description for new methods. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43095 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* ext/objspace/object_tracing.c: Return for ::allocation_generationzzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* ext/objspace/object_tracing.c: Document object_tracing methods.zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41385 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* ext/objspace/objspace.c: Document ObjectSpace::InternalObjectWrapper.zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* ext/objspace/object_tracing.c: Teach rdoc object_tracing.c [Bug #8537]zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41382 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-18* ext/objspace/objspace.c: rdoc on require to overview from r41355zzak
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41380 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-17* ext/objspace/objspace.c: let rdoc know about objspace methods.eregon
Specify 'objspace' should be required. See #8537. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41355 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-17* gc.c (ObjectSpace): is a module not a class.eregon
* ext/objspace/objspace.c: try to include overview in rdoc, see #8537. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41354 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06* ext/objspace/object_tracing.c: rename allocation_info tonari
lookup_allocation_info. At times I confused "struct allocation_info" with "function allocation_info". git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41104 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-06* ext/objspace/object_tracing.c: allocation_info function isn'tnari
called by any other file. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41103 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-06-04* ext/objspace/objspace.c: improve wording and remove duplicated comment.eregon
Based on a patch by Dave Goodchild. [Fixes GH-299] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41061 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28fix typotmm1
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40977 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28object_tracing.c: fix argument typenobu
* ext/objspace/object_tracing.c (make_unique_str): fix argument type. use long for string length. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40975 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28* ext/objspace/object_tracing.c: fix a bug reported atko1
"[ruby-core:55182] [ruby-trunk - Bug #8456][Open] Sugfault in Ruby Head" Care about the case TracePoint#path #=> `nil'. * ext/objspace/object_tracing.c: add two new methods: * ObjectSpace.allocation_class_path(o) * ObjectSpace.allocation_method_id(o) They are not useful for Object.new because they are always "Class" and :new. To trace more useful information, we need to maintain call-tree using call/return hooks, which is implemented by ll-prof <http://sunagae.net/wiki/doku.php?id=software:llprof> * test/objspace/test_objspace.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40974 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-28ext/objspace: unexpand Author keywordsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40972 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27* properties.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27* ext/objspace/gc_hook.c, ext/objspace/objspace.c: add new methods toko1
hook GC invocation. * ObjectSpace.after_gc_start_hook=(proc) * ObjectSpace.after_gc_end_hook=(proc) Note that hooks are not kicked immediately. Procs are kicked at postponed_job. This feature is a sample of new internal event and rb_postponed_job API. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27suppress warningsnobu
* ext/-test-/postponed_job/postponed_job.c (pjob_register), (pjob_call_direct): none void function. * ext/-test-/tracepoint/tracepoint.c (tracepoint_track_objspace_events): adjust type to get rid of implicit cast. * ext/objspace/object_tracing.c (newobj_i): ditto. * ext/tk/tkutil/tkutil.c (tk_conv_args): adjust type against RHASH_SIZE(). git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40965 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27* include/ruby/ruby.h: rename RUBY_INTERNAL_EVENT_FREE toko1
RUBY_INTERNAL_EVENT_FREEOBJ. * ext/-test-/tracepoint/tracepoint.c, ext/objspace/object_tracing.c, gc.c, vm_trace.c: catch up this change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40959 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-05-27* ext/objspace/objspace.c: support ObjectSpace.trace_object_allocations.ko1
Read the following test to know HOWTO. This feature is a sample of RUBY_INTERNAL_EVENT. * test/objspace/test_objspace.rb: add a test. * ext/objspace/object_tracing.c: ditto. * gc.c (rb_gc_count): add. THis function returns GC count. * internal.h: add decl. of rb_gc_count(). Same as `GC.count'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40957 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-13* lib/mkmf.rb: Add ruby/ruby.h, ruby/missing.h, ruby/intern.h,akr
ruby/st.h and ruby/subst.h for ruby_headers in generated Makefile. * ext/-test-/old_thread_select/depend: Update dependencies. * ext/-test-/wait_for_single_fd/depend: Ditto. * ext/bigdecimal/depend: Ditto. * ext/curses/depend: Ditto. * ext/digest/bubblebabble/depend: Ditto. * ext/digest/depend: Ditto. * ext/digest/md5/depend: Ditto. * ext/digest/rmd160/depend: Ditto. * ext/digest/sha1/depend: Ditto. * ext/digest/sha2/depend: Ditto. * ext/dl/callback/depend: Ditto. * ext/dl/depend: Ditto. * ext/etc/depend: Ditto. * ext/nkf/depend: Ditto. * ext/objspace/depend: Ditto. * ext/pty/depend: Ditto. * ext/readline/depend: Ditto. * ext/ripper/depend: Ditto. * ext/sdbm/depend: Ditto. * ext/socket/depend: Ditto. * ext/stringio/depend: Ditto. * ext/strscan/depend: Ditto. * ext/syslog/depend: Ditto. * ext/-test-/num2int/depend: Removed. * ext/dbm/depend: Ditto. * ext/fcntl/depend: Ditto. * ext/gdbm/depend: Ditto. * ext/racc/cparse/depend: Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40268 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-19* ext/objspace/objspace.c: Fix typo in doc. Patch by Sho Hashimoto.sorah
[Bug #8116] [ruby-dev:47177] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39817 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-03-05objspace.c: newly added nodesnobu
* ext/objspace/objspace.c (count_nodes): count also newly added nodes, and fix key for unknown node. patch by tmm1 (Aman Gupta) in [ruby-core:53130] [Bug #8014] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@39595 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-01-26fix typosnari
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38951 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-12-08* ext/objspace/objspace.c (iow_size): return size of internal objectko1
for ObjectSpace.memsize_of(). * test/objspace/test_objspace.rb: add a test. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38266 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24objspace.c: enum ruby_value_typenobu
* ext/objspace/objspace.c (type2sym, count_objects_size): use enum instead of size_t which may be larger than actual values. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24* ext/objspace/objspace.c (reachable_object_from_i): change datako1
structure of the result of reachable objects. Keys of table contains object_id of each reachable objects. Value of table is an object itself or an instance of InternalObjectWrapper. To avoid duplication, we use st_table and object_id keys. * ext/objspace/objspace.c (type2sym): bug fix. Should use `i' instead of `type'. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37310 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24* ext/objspace/objspace.c (Init_objspace): add a new methodko1
`ObjectSpace::InternalObjectWrapper#internal_object_id' which returns an object id of a wrapped internal object. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37308 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-10-24* ext/objspace/objspace.c (ObjectSpace.reachable_objects_from):ko1
internal object support. If given object `obj' has references to internal objects (such as T_NODE objects), then this method returns instances of `ObjectSpace::InternalObjectWrapper' instead of that internal objects. This instance contains a refereance to an internal object and you can check the type of internal object using `ObjectSpace::InternalObjectWrapper#type' method. Rdoc of `InternalObjectWrapper' is not prepared yet. * gc.c (rb_objspace_reachable_objects_from), gc.h: change an interface of 'rb_objspace_reachable_objects_from()' * gc.c, gc.h: add two APIs - rb_objspace_markable_object_p(obj): check markable or not. - rb_objspace_internal_object_p(obj): check internal or not. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37307 b2dd03c8-39d4-4d8f-98ff-823fe69b080e