@@ -45,6 +45,7 @@ def initialize(interface)
45
45
end
46
46
47
47
def print_msg ( *args )
48
+ puts 'def print_msg(*args)'
48
49
msg , *args = args
49
50
xml_message = CGI . escapeHTML ( msg % args )
50
51
print "<message>#{ xml_message } </message>"
@@ -384,7 +385,7 @@ def max_compact_name_size
384
385
50
385
386
end
386
387
387
- def inspect_with_allocation_control ( slice , memory_limit )
388
+ def inspect_with_allocation_control ( slice , memory_limit , obj_id )
388
389
curr_thread = Thread . current
389
390
390
391
start_alloc_size = ObjectSpace . memsize_of_all
@@ -395,7 +396,7 @@ def inspect_with_allocation_control(slice, memory_limit)
395
396
if ( curr_alloc_size - start_alloc_size > 1e6 * memory_limit )
396
397
397
398
trace . disable
398
- curr_thread . raise MemoryLimitError , "Out of memory: evaluation took longer than #{ memory_limit } mb." if curr_thread . alive?
399
+ curr_thread . raise MemoryLimitError , "Out of memory: evaluation of inspect for obj( #{ obj_id } ) took more than #{ memory_limit } mb." if curr_thread . alive?
399
400
end
400
401
end
401
402
@@ -404,6 +405,7 @@ def inspect_with_allocation_control(slice, memory_limit)
404
405
trace . disable
405
406
result
406
407
rescue MemoryLimitError => e
408
+ print_msg ( e . message )
407
409
return nil
408
410
end
409
411
@@ -413,7 +415,7 @@ def compact_array_str(value)
413
415
compact = if ( defined? ( JRUBY_VERSION ) || ENV [ 'DEBUGGER_MEMORY_LIMIT' ] . to_i <= 0 )
414
416
slice . inspect
415
417
else
416
- compact = inspect_with_allocation_control ( slice , ENV [ 'DEBUGGER_MEMORY_LIMIT' ] . to_i )
418
+ compact = inspect_with_allocation_control ( slice , ENV [ 'DEBUGGER_MEMORY_LIMIT' ] . to_i , value . object_id . to_s )
417
419
end
418
420
419
421
if compact && value . size != slice . size
0 commit comments