### Godot version

4.0 beta17

### System information

win10 Gles3 

### Issue description

i am using tilemap to setup RTS game.
use draw_dashed_line function drew 192 v-dashlines  , 192 h-dashlines, 
the _draw function run only once , 
than run my scene , 2G memory has been consumed.
The following is the comparison data （before and drew）：
before：
![%HLAHK A3ULQD8}4DTW0254](https://user-images.githubusercontent.com/6269655/216816409-d62398c1-2cf8-4a95-ad72-0cee5702700e.png)
after
![2 Z(P162O 7LRXR6{C@}VEW](https://user-images.githubusercontent.com/6269655/216816415-1034ee58-43c2-45a9-a3dc-e3c315a16101.png)
---
the code 
---
func _draw():
	if world:
		draw_pave_grid()
	print("drawn")

func draw_pave_grid():
	var k =0
	for i in world.tmapSize.y:
		draw_dashed_line(Vector2(world.worldStart.x,world.worldStart.y+i*world.cellSize.y),
			Vector2(world.worldEnd.x,world.worldStart.y+i*world.cellSize.y),_line_color,_line_width)
		k+=1			
	
	for i in world.tmapSize.x:
		draw_dashed_line(Vector2(world.worldStart.x+i*world.cellSize.x,world.worldStart.y),
			Vector2(world.worldStart.x+i*world.cellSize.x,world.worldEnd.y),_line_color,_line_width)
		k+=1

and the world size is :  wsize (8032, 4256) 
the cell size is  32X32
...
wstart (-1504, -800) wend (6528, 3456) wsize (8032, 4256) whsize (4016, 2128) center (2512, 1328) 
384 lines drew



### Steps to reproduce

setup a big tilemap with 32X32 tile , map size is about 8K X 4K,
then darw dash line(about 200X200) grid  once 
the memory will be eat up




### Minimal reproduction project

sorry
ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
	RenderingServer::get_singleton()->canvas_item_add_animation_slice(canvas_item, p_animation_length, p_slice_begin, p_slice_end, p_offset);
}
void CanvasItem::draw_end_animation() {
	ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
	RenderingServer::get_singleton()->canvas_item_add_animation_slice(canvas_item, 1, 0, 2, 0);
}
void CanvasItem::draw_polygon(const Vector<Point2> &p_points, const Vector<Color> &p_colors, const Vector<Point2> &p_uvs, Ref<Texture2D> p_texture) {
	ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
	RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
	RenderingServer::get_singleton()->canvas_item_add_polygon(canvas_item, p_points, p_colors, p_uvs, rid);
}
void CanvasItem::draw_colored_polygon(const Vector<Point2> &p_points, const Color &p_color, const Vector<Point2> &p_uvs, Ref<Texture2D> p_texture) {
	ERR_FAIL_COND_MSG(!drawing, "Drawing is only allowed inside NOTIFICATION_DRAW, _draw() function or 'draw' signal.");
	Vector<Color> colors;
	colors.push_back(p_color);
	RID rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
	RenderingServer::get_singleton()->canvas_item_add_polygon(canvas_item, p_points, colors, p_uvs, rid);
}
void CanvasItem::draw_mesh(const Ref<Mesh> &p_mesh, const Ref<Texture2D> &p_texture, const Transform2D &p_transform, const Color &p_modulate) {
	ERR_FAIL_COND(p_mesh.is_null());
	RID texture_rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
	RenderingServer::get_singleton()->canvas_item_add_mesh(canvas_item, p_mesh->get_rid(), p_transform, p_modulate, texture_rid);
}
void CanvasItem::draw_multimesh(const Ref<MultiMesh> &p_multimesh, const Ref<Texture2D> &p_texture) {
	ERR_FAIL_COND(p_multimesh.is_null());
	RID texture_rid = p_texture.is_valid() ? p_texture->get_rid() : RID();
	RenderingServer::get_singleton()->canvas_item_add_multimesh(canvas_item, p_multimesh->get_rid(), texture_rid);
}
void CanvasItem::draw_string(const Ref<Font> &p_font, const Point2 &p_pos, const String &p_text, HorizontalAlignment p_alignment, float p_width, int p_font_size, const Color &p_modulate, BitField<TextServer::JustificationFlag> p_jst_flags, TextServer::Direction p_direction, TextServer::Orientation p_orientation) const {