Skip to content

GitLab

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
I
iTasks-SDK
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 84
    • Issues 84
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 10
    • Merge Requests 10
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Operations
    • Operations
    • Incidents
    • Environments
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • clean-and-itasks
  • iTasks-SDK
  • Issues
  • #384

Closed
Open
Opened Mar 29, 2020 by Camil Staps@cstaps🚀Owner

Possible memory leak

The following example prints the heap size of the memory shares. Upon every refresh, the size of the taskreducts, taskvalues, taskOutput, and tasklist increase. The total increase is around 20kB per refresh. I would expect that there is no state that should be kept, so that the sizes stay the same.

@baslijns, @smichels?

module test

import StdEnv

import qualified Data.Map

import graph_copy

import iTasks
import iTasks.Internal.IWorld
import iTasks.Internal.Task

:: DebugInfo =
	{ memory_shares :: !ShareSizes
	}

:: ShareSizes =
	{ total_size :: !Int
	, elements   :: ![(String,Int)]
	}

derive class iTask DebugInfo, ShareSizes

Start w = doTasks showDebugInfo w

showDebugInfo = getInfo >>- viewInformation []
where
	getInfo :: Task DebugInfo
	getInfo = mkInstantTask \_ iworld
		# (info,iworld) = getInfo iworld
		-> (Ok info, iworld)
	where
		getInfo :: !*IWorld -> (!DebugInfo, !*IWorld)
		getInfo iworld=:{memoryShares} =
			( {memory_shares=shareSizes memoryShares}
			, iworld
			)

		shareSizes :: !('Data.Map'.Map String a) -> ShareSizes
		shareSizes shares =
			{ total_size = sum (map snd elements)
			, elements   = elements
			}
		where
			elements = [(name, fst (usize (copy_to_string val))) \\ (name,val) <- 'Data.Map'.toList shares]
Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
None
Due date
None
Reference: clean-and-itasks/iTasks-SDK#384